-
Notifications
You must be signed in to change notification settings - Fork 2
/
bandwagonhost-debian-ss-polarssl.sh
86 lines (74 loc) · 2.75 KB
/
bandwagonhost-debian-ss-polarssl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#! /bin/bash
#===============================================================================================
# System Required: Debian or Ubuntu (32bit/64bit)
# Description: Install Shadowsocks(libev) for Debian or Ubuntu
# Author: tennfy <[email protected]>
# Modifier: wongsyrone
#===============================================================================================
clear
echo "#############################################################"
echo "# Install Shadowsocks(libev) for Debian or Ubuntu (32bit/64bit)"
echo "#"
echo "# This version with polarssl support"
echo "#"
echo "#############################################################"
echo ""
# prepare packages
apt-get update
apt-get install -y --force-yes build-essential autoconf libtool libssl-dev git
# go to /root dir
cd /root
# build polarssl library using make
# please refer to polarssl's Makefile
git clone https://github.com/polarssl/polarssl.git
cd polarssl
make lib
cd ..
#download source code
# madeye had already transfered to shadowsocks
git clone https://github.com/shadowsocks/shadowsocks-libev.git
#compile install
cd shadowsocks-libev
./configure --prefix=/usr --with-crypto-library=polarssl --with-polarssl-include=/root/polarssl/include --with-polarssl-lib=/root/polarssl/library
make && make install
mkdir -p /etc/shadowsocks-libev
cp ./debian/shadowsocks-libev.init /etc/init.d/shadowsocks-libev
cp ./debian/shadowsocks-libev.default /etc/default/shadowsocks-libev
chmod +x /etc/init.d/shadowsocks-libev
# Get IP address(Default No.1)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.*' | cut -d: -f2 | awk '{ print $1}' | head -1`;
#config setting
echo "#############################################################"
echo "#"
echo "# Please input your shadowsocks server_port and password"
echo "# Default is aes-256-cfb, which is highly recommended"
echo "#############################################################"
echo ""
echo -n "input server_port(443 is suggested) :"
read serverport
echo -n "input password :"
read shadowsockspwd
# Config shadowsocks
cat > /etc/shadowsocks-libev/config.json<<-EOF
{
"server":"${IP}",
"server_port":${serverport},
"local_port":1080,
"password":"${shadowsockspwd}",
"timeout":60,
"method":"aes-256-cfb"
}
EOF
#restart
/etc/init.d/shadowsocks-libev restart
#start with boot
update-rc.d shadowsocks-libev defaults
#echo "nohup /usr/bin/ss-server -c /etc/shadowsocks-libev/config.json > /dev/null 2>&1 &">> /etc/rc.local
#install successfully
echo ""
echo "Congratulations, shadowsocks-libev install completed!"
echo -e "Your Server IP: ${IP}"
echo -e "Your Server Port: ${serverport}"
echo -e "Your Password: ${shadowsockspwd}"
echo -e "Your Local Port: 1080"
echo -e "Your Encryption Method:aes-256-cfb"