forked from flyzy2005/ss-fly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#! /bin/bash | ||
# Copyright (c) 2018 flyzy2005 | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
usage () { | ||
cat $DIR/sshelp | ||
} | ||
|
||
wrong_para_prompt() { | ||
echo "参数输入错误!$1" | ||
} | ||
|
||
install() { | ||
if [[ "$#" -ne 1 ]]; then | ||
wrong_para_prompt "请输入密码" | ||
return 1 | ||
fi | ||
echo "{ | ||
\"server\":\"0.0.0.0\", | ||
\"server_port\":8388, | ||
\"local_address\": \"127.0.0.1\", | ||
\"local_port\":1080, | ||
\"password\":\"$1\", | ||
\"timeout\":300, | ||
\"method\":\"aes-256-cfb\" | ||
}" > /etc/shadowsocks.json | ||
apt-get update | ||
apt-get install -y python-pip | ||
pip install --upgrade pip | ||
pip install setuptools | ||
pip install shadowsocks | ||
chmod 755 /etc/shadowsocks.json | ||
apt-get install python-m2crypto | ||
ssserver -c /etc/shadowsocks.json -d start | ||
sed -i '$i\ssserver -c /etc/shadowsocks.json -d start' /etc/rc.local | ||
echo '安装成功~尽情冲浪吧' | ||
} | ||
|
||
if [ "$#" -eq 0 ]; then | ||
usage | ||
exit 0 | ||
fi | ||
|
||
case $1 in | ||
-h|h|help ) | ||
usage | ||
exit 0; | ||
;; | ||
-v|v|version ) | ||
echo 'ss-fly Version 1.0, 2018-01-20, Copyright (c) 2018 flyzy2005' | ||
exit 0; | ||
;; | ||
esac | ||
|
||
if [ "$EUID" -ne 0 ]; then | ||
echo '必需以root身份运行,请使用sudo命令' | ||
exit 1; | ||
fi | ||
|
||
case $1 in | ||
-i|i|install ) | ||
install $2 | ||
;; | ||
* ) | ||
usage | ||
;; | ||
esac |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
声明: | ||
只在Vultr的Ubuntu16.04上测试了 | ||
用法: | ||
显示版本: | ||
ss-fly.sh -v|v|version | ||
显示帮助: | ||
ss-fly.sh [-h|h|help] | ||
一键安装: | ||
ss-fly.sh -i|i|install |