forked from shadowsocks/stackscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstackscript.sh
More file actions
23 lines (16 loc) · 818 Bytes
/
stackscript.sh
File metadata and controls
23 lines (16 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
apt-get update
apt-get install -y -qq python-pip python-m2crypto supervisor
pip install shadowsocks
SS_PASSWORD=`dd if=/dev/random bs=32 count=1 | md5sum | cut -c-32`
SS_PORT=`shuf -i 2000-8000 -n 1`
wget https://raw.githubusercontent.com/shadowsocks/stackscript/master/shadowsocks.json -O /etc/shadowsocks.json
wget https://raw.githubusercontent.com/shadowsocks/stackscript/master/shadowsocks.conf -O /etc/supervisor/conf.d/shadowsocks.conf
wget https://raw.githubusercontent.com/shadowsocks/stackscript/master/local.conf -O /etc/sysctl.d/local.conf
sed -i -e s/SS_PASSWORD/$SS_PASSWORD/ /etc/shadowsocks.json
sed -i -e s/SS_PORT/$SS_PORT/ /etc/shadowsocks.json
sysctl --system
service supervisor stop
echo 'ulimit -n 51200' >> /etc/default/supervisor
service supervisor start
supervisorctl reload