Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
flyzy2005 authored and HarukaMa committed Jan 20, 2018
0 parents commit 05bd787
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
67 changes: 67 additions & 0 deletions ss-fly.sh
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
9 changes: 9 additions & 0 deletions sshelp
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

0 comments on commit 05bd787

Please sign in to comment.