Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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"
Add Comment
Please, Sign In to add comment