Skip to content

Commit

Permalink
相逢有时,后会无期。
Browse files Browse the repository at this point in the history
防止文件遗漏
  • Loading branch information
ImAnyOne authored Jul 22, 2017
1 parent 765cbea commit 1b47c8e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 22 deletions.
15 changes: 1 addition & 14 deletions self-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,9 @@ if [ ! -f "/usr/local/shadowsocksr/stop.sh" ]; then
echo "SSR Miss" >> /root/report.json
exit
fi
#Network Test
echo "############Intelnet Test" >> /root/report.json
cd /root
curl http://myip.ipip.net
curl http://myip.ipip.net >> /root/report.json
curl -o test.net https://www.google.com
if [ ! -f "/root/test.net" ]; then
echo "Intelnet Error,请确认服务器是否联网"
echo "Intelnet Miss" >> /root/report.json
exit
fi
ping www.google.com -c 5 >> /root/report.json
ping www.facebook.com -c 5 >> /root/report.json

#Firewall
echo "############Firewall test" >> report.json
iptables -L >> /root/report.json

echo "检测完成,未发现严重问题,如仍有任何问题请提交report.json"
echo "检测完成,未发现严重问题,如仍有任何问题请提交report.json"
43 changes: 39 additions & 4 deletions user/add.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ read -p "输入端口: " uport
read -p "输入密码: " upass
echo ""
echo "加密方式"
echo '1.aes-192-cfb'
echo '1.none'
echo '2.aes-128-cfb'
echo '3.aes-256-cfb'
echo '4.aes-128-ctr'
Expand All @@ -66,9 +66,10 @@ echo '2.auth_sha1_v4'
echo '3.auth_aes128_md5'
echo '4.auth_aes128_sha1'
echo '5.verify_deflate'
echo '6.auth_chain_a'
while :; do echo
read -p "输入协议方式: " ux
if [[ ! $ux =~ ^[1-5]$ ]]; then
if [[ ! $ux =~ ^[1-6]$ ]]; then
echo "输入错误! 请输入正确的数字!"
else
break
Expand Down Expand Up @@ -115,7 +116,7 @@ fi


if [[ $um == 1 ]];then
um1="aes-192-cfb"
um1="none"
fi
if [[ $um == 2 ]];then
um1="aes-128-cfb"
Expand Down Expand Up @@ -157,6 +158,11 @@ fi
if [[ $ux == 5 ]];then
ux1="verify_deflate"
fi

if [[ $ux == 6 ]];then
ux1="auth_chain_a"
fi

if [[ $uo == 1 ]];then
uo1="plain"
fi
Expand Down Expand Up @@ -187,6 +193,28 @@ while :; do echo
fi
done

while :; do echo
read -p "是否开启端口限速(y/n): " iflimitspeed
if [[ ! $iflimitspeed =~ ^[y,n]$ ]]; then
echo "输入错误! 请输入y或者n!"
else
break
fi
done

if [[ $iflimitspeed == y ]]; then
while :; do echo
read -p "输入端口总限速(只需输入数字,单位:KB/s): " us
if [[ "$us" =~ ^(-?|\+?)[0-9]+(\.?[0-9]+)?$ ]];then
break
else
echo 'Input Error!'
fi
done
fi



#Set Firewalls
if [[ ${OS} =~ ^Ubuntu$|^Debian$ ]];then
iptables-restore < /etc/iptables.up.rules
Expand Down Expand Up @@ -214,7 +242,14 @@ fi
#Run ShadowsocksR
echo "用户添加成功!用户信息如下:"
cd /usr/local/shadowsocksr
python mujson_mgr.py -a -u $uname -p $uport -k $upass -m $um1 -O $ux1 -o $uo1 -t $ut

if [[ $iflimitspeed == y ]]; then
python mujson_mgr.py -a -u $uname -p $uport -k $upass -m $um1 -O $ux1 -o $uo1 -t $ut -S $us
else
python mujson_mgr.py -a -u $uname -p $uport -k $upass -m $um1 -O $ux1 -o $uo1 -t $ut
fi


SSRPID=$(ps -ef|grep 'python server.py m' |grep -v grep |awk '{print $2}')
if [[ $SSRPID == "" ]]; then

Expand Down
35 changes: 31 additions & 4 deletions user/edit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ echo "5.修改协议参数"
echo "6.修改混淆参数"
echo "7.修改流量"
echo "8.修改端口限制"
echo "9.修改总端口限速"

while :; do echo
read -p "请选择: " ec
if [[ ! $ec =~ ^[1-8]$ ]]; then
if [[ ! $ec =~ ^[1-9]$ ]]; then
echo "输入错误! 请输入正确的数字!"
else
break
Expand All @@ -87,7 +88,7 @@ if [[ $ec == 1 ]];then
fi
if [[ $ec == 2 ]];then
echo "加密方式"
echo '1.aes-192-cfb'
echo '1.none'
echo '2.aes-128-cfb'
echo '3.aes-256-cfb'
echo '4.aes-128-ctr'
Expand All @@ -106,7 +107,7 @@ if [[ $ec == 2 ]];then
done

if [[ $um == 1 ]];then
um1="aes-192-cfb"
um1="none"
fi
if [[ $um == 2 ]];then
um1="aes-128-cfb"
Expand Down Expand Up @@ -151,9 +152,10 @@ if [[ $ec == 3 ]];then
echo '3.auth_aes128_md5'
echo '4.auth_aes128_sha1'
echo '5.verify_deflate'
echo '6.auth_chain_a'
while :; do echo
read -p "输入协议方式: " ux
if [[ ! $ux =~ ^[1-5]$ ]]; then
if [[ ! $ux =~ ^[1-6]$ ]]; then
echo "输入错误! 请输入正确的数字!"
else
break
Expand Down Expand Up @@ -186,6 +188,9 @@ if [[ $ec == 3 ]];then
if [[ $ux == 5 ]];then
ux1="verify_deflate"
fi
if [[ $ux == 6 ]];then
ux1="auth_chain_a"
fi

if [[ $ifprotocolcompatible == y ]]; then
ux1=${ux1}"_compatible"
Expand Down Expand Up @@ -321,3 +326,25 @@ if [[ $ec == 8 ]];then
echo "此功能目前无法使用"
fi
fi

if [[ $ec == 9 ]];then
while :; do echo
read -p "输入端口总限速(只需输入数字,单位:KB/s): " us
if [[ "$us" =~ ^(-?|\+?)[0-9]+(\.?[0-9]+)?$ ]];then
break
else
echo 'Input Error!'
fi
done
cd /usr/local/shadowsocksr
if [[ $lsid == 1 ]];then
cd /usr/local/shadowsocksr
python mujson_mgr.py -e -u $uid -S $us
echo "用户名为 $uid 的用户端口限速已修改为 $us KB/s"
fi
if [[ $lsid == 2 ]];then
cd /usr/local/shadowsocksr
python mujson_mgr.py -e -p $uid -S $us
echo "端口号为 $uid 的用户端口限速已修改为 $us KB/s"
fi
fi

0 comments on commit 1b47c8e

Please sign in to comment.