Skip to content

Commit

Permalink
whiptail for passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
jvonau committed Sep 4, 2020
1 parent c9ea90f commit 3ace584
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions iiab-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,16 @@ fi

# B. Ask for password change if pi/raspberry default remains
if check_user_pwd "pi" "raspberry"; then
echo -e "\n\nRaspberry Pi's are COMPROMISED often if the default password is not changed!\n"
echo -n "What password do you want for GNU/Linux user 'pi' ? "
read -t 5 ans < /dev/tty # Whines but doesn't change password if [Enter]
echo pi:"$ans" | chpasswd || true # Overrides 'set -e'
if [ $INTERACTIVE == 1 ]; then
whiptail --msgbox "\
Raspberry Pi's are COMPROMISED often if the default password is not changed!
What password do you want for GNU/Linux user 'pi' ?
press [Enter] 3 times for no change \
" 20 60 1
passwd pi &&
whiptail --msgbox "done" 20 60 1
#chpasswd || true # Overrides 'set -e'
fi
fi

# C. Create user 'iiab-admin' as nec, with default password
Expand All @@ -143,13 +149,15 @@ fi
# D. Ask for password change if iiab-admin/g0adm1n default remains
if check_user_pwd "iiab-admin" "g0adm1n"; then
echo -e "\n\nUser 'iiab-admin' retains default password 'g0adm1n' per http://FAQ.IIAB.IO\n"

echo -e "This is for login to Internet-in-a-Box's Admin Console (http://box.lan/admin)\n"
if [ $INTERACTIVE == 1 ]; then
echo -n "What password do you want for GNU/Linux user 'iiab-admin' ? "
echo -n "press [Enter] for no change"
read -t 15 ans < /dev/tty # Whines but doesn't change password if [Enter]
echo iiab-admin:"$ans" | chpasswd || true # Overrides 'set -e'
whiptail --msgbox "\
What password do you want for GNU/Linux user 'iiab-admin' ?
press [Enter] 3 times for no change /
" 20 60 1
passwd iiab-admin &&
whiptail --msgbox "done" 20 60 1
#chpasswd || true # Overrides 'set -e'
fi
fi

Expand Down

0 comments on commit 3ace584

Please sign in to comment.