Skip to content

Commit 828443d

Browse files
authored
Update centos_install_ssr.sh
1 parent 19634ca commit 828443d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

centos_install_ssr.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function preinstall()
240240
yum update -y
241241
fi
242242
echo "安装必要软件"
243-
yum install -y epel-release telnet curl wget vim net-tools libsodium openssl unzip tar
243+
yum install -y epel-release telnet curl wget vim net-tools libsodium openssl unzip tar qrencode
244244
res=`which wget`
245245
[ "$?" != "0" ] && yum install -y wget
246246
res=`which netstat`
@@ -370,6 +370,7 @@ function installBBR()
370370

371371
function info()
372372
{
373+
yum install -y qrencode
373374
ip=`curl -s -4 icanhazip.com`
374375
port=`cat /etc/shadowsocksR.json | grep server_port | cut -d: -f2 | tr -d \",' '`
375376
res=`netstat -nltp | grep ${port} | grep python`
@@ -379,6 +380,12 @@ function info()
379380
protocol=`cat /etc/shadowsocksR.json | grep protocol | cut -d: -f2 | tr -d \",' '`
380381
obfs=`cat /etc/shadowsocksR.json | grep obfs | cut -d: -f2 | tr -d \",' '`
381382

383+
p1=`echo -n ${password} | base64 -w 0`
384+
p1=`echo -n ${p1} | tr -d =`
385+
res=`echo -n "${ip}:${port}:${protocol}:${method}:${obfs}:${p1}/?remarks=&protoparam=&obfsparam=" | base64 -w 0`
386+
res=`echo -n ${res} | tr -d =`
387+
link="ssr://${res}"
388+
382389
echo ============================================
383390
echo -e " ssr运行状态:${status}"
384391
echo -e " ssr配置文件:${red}/etc/shadowsocksR.json${plain}"
@@ -390,8 +397,9 @@ function info()
390397
echo -e " 加密方式(method): ${red}${method}${plain}"
391398
echo -e " 协议(protocol):" ${red}${protocol}${plain}
392399
echo -e " 混淆(obfuscation):" ${red}${obfs}${plain}
393-
echo
394-
echo ============================================
400+
echo
401+
echo " ssr链接: $link"
402+
qrencode -o - -t utf8 $link
395403
}
396404

397405
function bbrReboot()

0 commit comments

Comments
 (0)