Skip to content

Instantly share code, notes, and snippets.

@int64ago
Created January 29, 2015 12:31
Show Gist options
  • Save int64ago/a2cb605693dfd4c5c65a to your computer and use it in GitHub Desktop.
Save int64ago/a2cb605693dfd4c5c65a to your computer and use it in GitHub Desktop.
shadowsocks server auto deploying script for ubuntu14.04
#!/bin/bash
if [ X$1 = X ]
then
echo 'No passwd input!'
exit
fi
apt-get update
apt-get -y install python-pip python-m2crypto supervisor
pip install shadowsocks
ss_conf=/etc/shadowsocks.conf
supervisor_conf=/etc/supervisor/conf.d/shadowsocks.conf
passwd=$1
echo '{' > $ss_conf
echo ' "server": "0.0.0.0",' >> $ss_conf
echo ' "server_port": 443,' >> $ss_conf
echo ' "local_address": "127.0.0.1",' >> $ss_conf
echo ' "local_port": 1080,' >> $ss_conf
echo ' "password": "'$passwd'",' >> $ss_conf
echo ' "timeout": 600,' >> $ss_conf
echo ' "method": "aes-256-cfb"' >> $ss_conf
echo '}' >> $ss_conf
echo '[program:shadowsocks]' > $supervisor_conf
echo 'command=ssserver -c '$ss_conf >> $supervisor_conf
echo 'autorestart=true' >> $supervisor_conf
echo 'user=root' >> $supervisor_conf
echo 'ulimit -n 51200' >> /etc/default/supervisor
service supervisor start
supervisorctl reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment