summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-01-16 12:02:08 -0300
committerRoger Gonzalez <roger@rogs.me>2023-01-16 12:02:08 -0300
commitebb71068a4b8e8654a8924b0e3c438f17a138bdb (patch)
tree2ef93a75f24b0fcb40639cab37aa92e32ba3e80b
parent49f0ab5b4615c1159db7c966cbc8863d38c1cf57 (diff)
Added password feedback with "*"
-rwxr-xr-xinstall.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/install.sh b/install.sh
index c043829..4cca791 100755
--- a/install.sh
+++ b/install.sh
@@ -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"}