Created
September 22, 2019 10:34
-
-
Save greatbody/7818642a4b3cec2a1fed2ada333bdf8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# update package | |
apt-get update -y | |
apt install shadowsocks-libev -y | |
echo "{ | |
\"server\": \"SERVER_IP\", | |
\"server_port\": 443, | |
\"local_port\": 1080, | |
\"password\": \"YWJhYTcwZj\", | |
\"timeout\": 600, | |
\"method\": \"aes-256-cfb\" | |
}" > /tmp/config.json | |
HOST_IP=$(ifconfig eth0 | grep inet[[:space:]] | awk '{ print $2 };') | |
sed -i "s,SERVER_IP,${HOST_IP}," /tmp/config.json | |
mv /tmp/config.json /etc/shadowsocks-libev/config.json | |
/etc/init.d/shadowsocks-libev start | |
systemctl start shadowsocks-libev | |
systemctl enable shadowsocks-libev | |
sleep 5 | |
systemctl restart shadowsocks-libev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment