File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,18 @@ if [ "$#" != "1" ];then
6
6
fi
7
7
echo -e " \033[32mShadowsocks autoupdate utility\033[0m"
8
8
webroot=" /root/notgonnaexist"
9
- while [ -e " ${webroot} " ]; do
10
- read -p " Please provide your website root directory : " webroot
9
+ isexist=0
10
+ while [ " $isexist " != " 1" ]; do
11
+ if [ -d " ${webroot} " ]; then
12
+ echo -e " \033[32mWeb root directory exists!Proceed\033[0m"
13
+ isexist=1
14
+ else
15
+ read -p " Please provide your website root directory : " webroot
16
+ isexist=0
17
+ echo " ${webroot} " > /tmp/webroot.txt
18
+ fi
11
19
done
20
+
12
21
case $1 in
13
22
enable)
14
23
for exec in wget curl zip; do
@@ -18,6 +27,7 @@ enable)
18
27
wget --no-check-certificate -P /usr/lib/systemd/system/ https://wavejs.com/ssautoupdate.service
19
28
wget --no-check-certificate -P /usr/lib/systemd/system/ https://wavejs.com/ssautoupdate.timer
20
29
wget --no-check-certificate -P /root/ https://wavejs.com/ssautoupdate.sh
30
+ webroot=
21
31
sed -i " s/WEBROOT/\\ $webroot /i" /root/ssautoupdate.sh
22
32
systemctl enable ssautoupdate.service
23
33
systemctl start ssautoupdate.service
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ echo -e " \033[32mShadowsocks autoupdate utility\033[0m"
3
+ webroot=" /root/notgonnaexist"
4
+ isexist=0
5
+ while [ " $isexist " != " 1" ]; do
6
+ if [ -d " ${webroot} " ]; then
7
+ echo -e " \033[32mWeb root directory exists!Proceed\033[0m"
8
+ isexist=1
9
+ else
10
+ read -p " Please provide your website root directory : " webroot
11
+ isexist=0
12
+ fi
13
+ done
14
+ echo ${webroot}
You can’t perform that action at this time.
0 commit comments