Skip to content

Commit 3690c5e

Browse files
authored
Update ubuntu_install_ssr.sh
1 parent 828443d commit 3690c5e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ubuntu_install_ssr.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function preinstall()
238238
apt update && apt upgrade -y
239239

240240
echo "安装必要软件"
241-
apt install -y telnet curl wget vim net-tools libsodium18 openssl unzip
241+
apt install -y telnet curl wget vim net-tools libsodium18 openssl unzip qrencode
242242
res=`which wget`
243243
[ "$?" != "0" ] && apt install -y wget
244244
res=`which netstat`
@@ -349,6 +349,7 @@ function installBBR()
349349

350350
function info()
351351
{
352+
apt install -y qrencode
352353
ip=`curl -s -4 icanhazip.com`
353354
port=`cat /etc/shadowsocksR.json | grep server_port | cut -d: -f2 | tr -d \",' '`
354355
res=`netstat -nltp | grep ${port} | grep python`
@@ -358,6 +359,12 @@ function info()
358359
protocol=`cat /etc/shadowsocksR.json | grep protocol | cut -d: -f2 | tr -d \",' '`
359360
obfs=`cat /etc/shadowsocksR.json | grep obfs | cut -d: -f2 | tr -d \",' '`
360361

362+
p1=`echo -n ${password} | base64 -w 0`
363+
p1=`echo -n ${p1} | tr -d =`
364+
res=`echo -n "${ip}:${port}:${protocol}:${method}:${obfs}:${p1}/?remarks=&protoparam=&obfsparam=" | base64 -w 0`
365+
res=`echo -n ${res} | tr -d =`
366+
link="ssr://${res}"
367+
361368
echo ============================================
362369
echo -e " ssr运行状态:${status}"
363370
echo -e " ssr配置文件:${red}/etc/shadowsocksR.json${plain}"
@@ -369,8 +376,9 @@ function info()
369376
echo -e " 加密方式(method): ${red}${method}${plain}"
370377
echo -e " 协议(protocol):" ${red}${protocol}${plain}
371378
echo -e " 混淆(obfuscation):" ${red}${obfs}${plain}
372-
echo
373-
echo ============================================
379+
echo
380+
echo " ssr链接: $link"
381+
qrencode -o - -t utf8 $link
374382
}
375383

376384
function bbrReboot()

0 commit comments

Comments
 (0)