Backup /etc/rc.local before modify
This commit is contained in:
parent
2a70ef55a3
commit
7645cd27dd
|
|
@ -130,6 +130,7 @@ function install(){
|
||||||
# Add run on system start up
|
# Add run on system start up
|
||||||
cat /etc/rc.local | grep 'ss-server' > /dev/null 2>&1
|
cat /etc/rc.local | grep 'ss-server' > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
cp -f /etc/rc.local /etc/rc.local_bak
|
||||||
col=`awk 'END{print NR}' /etc/rc.local`
|
col=`awk 'END{print NR}' /etc/rc.local`
|
||||||
sed -i ''"$col"'i nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 &' /etc/rc.local
|
sed -i ''"$col"'i nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 &' /etc/rc.local
|
||||||
fi
|
fi
|
||||||
|
|
@ -187,6 +188,11 @@ function uninstall_shadowsocks_libev(){
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
# restore /etc/rc.local
|
||||||
|
if [[ -s /etc/rc.local_bak ]]; then
|
||||||
|
rm -f /etc/rc.local
|
||||||
|
mv /etc/rc.local_bak /etc/rc.local
|
||||||
|
fi
|
||||||
# delete config file
|
# delete config file
|
||||||
rm -rf /etc/shadowsocks
|
rm -rf /etc/shadowsocks
|
||||||
# delete shadowsocks
|
# delete shadowsocks
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user