Skip to content

Commit

Permalink
添加ss链接
Browse files Browse the repository at this point in the history
  • Loading branch information
flyzy2005 committed Oct 14, 2018
1 parent 33d16e7 commit 342561a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ss-fly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ install() {
echo -e "你的密码 :\033[41;37m ${password} \033[0m"
echo -e "你的端口 :\033[41;37m ${port} \033[0m"
echo -e "你的加密方式 :\033[41;37m aes-256-cfb \033[0m"
echo -e "欢迎访问flyzy小站 :\033[41;37m https://www.flyzy2005.com \033[0m"
echo -e "欢迎访问flyzy小站 :\033[41;37m https://www.flyzy2005.com \033[0m"
get_ss_link
}

cleanup() {
Expand All @@ -463,6 +464,19 @@ get_ip(){
[ ! -z ${IP} ] && echo ${IP} || echo
}

get_ss_link(){
if [ ! -f "/etc/shadowsocks.json" ]; then
echo 'shdowsocks配置文件不存在,请检查(/etc/shadowsocks.json)'
exit 1
fi
local tmp=$(echo -n "`get_config_value method`:`get_config_value password`@`get_ip`:`get_config_value server_port`" | base64 -w0)
echo -e "你的ss链接:\033[41;37m ss://${tmp} \033[0m"
}

get_config_value(){
cat /etc/shadowsocks.json | grep "\"$1\":"|awk -F ":" '{print $2}'| sed 's/\"//g;s/,//g;s/ //g'
}

if [ "$#" -eq 0 ]; then
usage
exit 0
Expand Down Expand Up @@ -497,6 +511,9 @@ case $1 in
-uninstall )
uninstall_ss
;;
-sslink )
get_ss_link
;;
* )
usage
;;
Expand Down
2 changes: 2 additions & 0 deletions sshelp
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
ss-fly.sh -uninstall
一键安装ssr:
ss-fly.sh -ssr
显示ss链接:
ss-fly.sh -sslink
安装BBR加速:
ss-fly.sh -bbr

0 comments on commit 342561a

Please sign in to comment.