Fix a run on system start up bug
This commit is contained in:
parent
3d601dbed5
commit
95820c7056
|
|
@ -130,7 +130,8 @@ 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
|
||||||
echo "nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 &" >> /etc/rc.local
|
col=`awk '/exit 0/ {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
|
||||||
fi
|
fi
|
||||||
# Run shadowsocks in the background
|
# Run shadowsocks in the background
|
||||||
nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 &
|
nohup /usr/local/bin/ss-server -c /etc/shadowsocks/config.json > /dev/null 2>&1 &
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user