diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-01-16 12:02:08 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-01-16 12:02:08 -0300 |
commit | ebb71068a4b8e8654a8924b0e3c438f17a138bdb (patch) | |
tree | 2ef93a75f24b0fcb40639cab37aa92e32ba3e80b /install.sh | |
parent | 49f0ab5b4615c1159db7c966cbc8863d38c1cf57 (diff) |
Added password feedback with "*"
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -123,8 +123,32 @@ if [ $setup_vpn == "y" ]; then read -p "What's your VPN service? (with spaces) [mullvad]: " vpn_service vpn_service=${vpn_service:-"mullvad"} read -p "What's your VPN username? (without spaces): " vpn_user - read -sp "What's your VPN password? (if you are using mullvad, just enter your username again): " vpn_password + + unset vpn_password + charcount=0 + prompt="What's your VPN password? (if you are using mullvad, just enter your username again): " + while IFS= read -p "$prompt" -r -s -n 1 char + do + if [[ $char == $'\0' ]] + then + break + fi + if [[ $char == $'\177' ]] ; then + if [ $charcount -gt 0 ] ; then + charcount=$((charcount-1)) + prompt=$'\b \b' + vpn_password="${vpn_password%?}" + else + prompt='' + fi + else + charcount=$((charcount+1)) + prompt='*' + vpn_password+="$char" + fi + done echo + echo "What country do you want to use?" read -p "You can check the countries list for your VPN here: https://github.com/qdm12/gluetun/wiki/$vpn_service#servers [brazil]: " vpn_country vpn_country=${vpn_country:-"brazil"} |