Skip to content

Instantly share code, notes, and snippets.

@HaskellZhangSong
Created October 16, 2019 02:58
Show Gist options
  • Save HaskellZhangSong/d8b6210a283410685fb7834944977b6c to your computer and use it in GitHub Desktop.
Save HaskellZhangSong/d8b6210a283410685fb7834944977b6c to your computer and use it in GitHub Desktop.
ss server config to ss url and qrcode
#! /bin/bash
method=`cat $1 | jq '.method'`
method1=`sed -e 's/^"//' -e 's/"$//' <<<"$method"`
password=`cat $1 | jq '.password'`
password1=`sed -e 's/^"//' -e 's/"$//' <<<"$password"`
server_port=`cat $1 | jq '.server_port'`
server_ip=`curl -s ip.sb`
url=$(echo -n "${method1}:${password1}@${server_ip}:${server_port}" | base64)
echo ss://$url
echo ss://$url | qrencode -t UTF8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment