Skip to content

Instantly share code, notes, and snippets.

@greatbody
Created September 22, 2019 10:34
Show Gist options
  • Save greatbody/7818642a4b3cec2a1fed2ada333bdf8b to your computer and use it in GitHub Desktop.
Save greatbody/7818642a4b3cec2a1fed2ada333bdf8b to your computer and use it in GitHub Desktop.
#!/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