Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8bd045

Browse files
author
Lisheng2016
committed
fixing bugs
1 parent 0b113a7 commit f8bd045

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

ssautoupdate/sssetup.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ if [ "$#" != "1" ];then
66
fi
77
echo -e "\033[32mShadowsocks autoupdate utility\033[0m"
88
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
1119
done
20+
1221
case $1 in
1322
enable)
1423
for exec in wget curl zip;do
@@ -18,6 +27,7 @@ enable)
1827
wget --no-check-certificate -P /usr/lib/systemd/system/ https://wavejs.com/ssautoupdate.service
1928
wget --no-check-certificate -P /usr/lib/systemd/system/ https://wavejs.com/ssautoupdate.timer
2029
wget --no-check-certificate -P /root/ https://wavejs.com/ssautoupdate.sh
30+
webroot=
2131
sed -i "s/WEBROOT/\\$webroot/i" /root/ssautoupdate.sh
2232
systemctl enable ssautoupdate.service
2333
systemctl start ssautoupdate.service

ssautoupdate/test.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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}

0 commit comments

Comments
 (0)