forked from rclone/rclone-webui-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webui.sh
77 lines (60 loc) · 1.24 KB
/
webui.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
username=''
password=''
repoName='rclone-webui-react'
command="$1"
errors=0
buildApp () {
npm install
npm run build
cd ..
}
if [[ -z "$username" ]]; then
#statements
echo "Please set username in the webui.sh"
errors=$((errors + 1))
fi
if [[ -z "$password" ]]; then
#statements
echo "Please set password in the webui.sh"
errors=$((errors + 1))
fi
if [[ $errors -ge 1 ]]; then
#statements
echo "$valid errors encountered. Please fix them to continue."
exit
fi
if [[ -z "$command" ]]; then
echo "Command not provided"
fi
if [[ "$command" == "get" ]]; then
#statements
# Replace code to download the prebuilt version
if [[ -n rclone-webui-react ]]; then
#statements
git clone https://github.com/rclone/"$repoName".git
fi
fi
if [[ "$command" == "build" ]]; then
#statements
if [[ -e "$repoName" ]]; then
#statements
cd rclone-webui-react
buildApp
fi
fi
if [[ "$command" == "update" ]]; then
#statements
cd rclone-webui-react
git pull
buildApp
fi
if [[ "$command" == "run" ]]; then
#statements
if [[ -e "$repoName"/build ]]; then
#statements
./rclone rcd --rc-serve --rc-user="$username" --rc-pass="$password" --rc-files="`pwd`/rclone-webui-react/build" -vv
else
echo "Please run build first"
fi
fi