Last active
March 4, 2018 11:59
-
-
Save markasoftware/1777d6999e9b9970d848cb832cb0e153 to your computer and use it in GitHub Desktop.
Shadowsocks QR Code Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make sure you have qrencode installed. Apart from that, you only need coreutils | |
read -p 'Algorithm? ' ss_algo | |
read -p 'Password? ' ss_pass | |
read -p 'Host? ' ss_host | |
read -p 'Port? ' ss_port | |
read -p 'Friendly name (optional)? ' ss_friend | |
read -p 'Output file name (in pwd)? ' ss_out | |
ss_encoded=$(echo -n "$ss_algo:$ss_pass@$ss_host:$ss_port" | base64 -w 0 - | tr -d '=') | |
[[ -n $ss_friend ]] && ss_url="ss://$ss_encoded#$ss_friend" || ss_url="ss://$ss_encoded" | |
qrencode -lM o "$ss_out" "$ss_url" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment