Skip to content

Commit 3ace584

Browse files
committed
whiptail for passwords
1 parent c9ea90f commit 3ace584

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

iiab-upgrade

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ fi
128128

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

137143
# C. Create user 'iiab-admin' as nec, with default password
@@ -143,13 +149,15 @@ fi
143149
# D. Ask for password change if iiab-admin/g0adm1n default remains
144150
if check_user_pwd "iiab-admin" "g0adm1n"; then
145151
echo -e "\n\nUser 'iiab-admin' retains default password 'g0adm1n' per http://FAQ.IIAB.IO\n"
146-
147152
echo -e "This is for login to Internet-in-a-Box's Admin Console (http://box.lan/admin)\n"
148153
if [ $INTERACTIVE == 1 ]; then
149-
echo -n "What password do you want for GNU/Linux user 'iiab-admin' ? "
150-
echo -n "press [Enter] for no change"
151-
read -t 15 ans < /dev/tty # Whines but doesn't change password if [Enter]
152-
echo iiab-admin:"$ans" | chpasswd || true # Overrides 'set -e'
154+
whiptail --msgbox "\
155+
What password do you want for GNU/Linux user 'iiab-admin' ?
156+
press [Enter] 3 times for no change /
157+
" 20 60 1
158+
passwd iiab-admin &&
159+
whiptail --msgbox "done" 20 60 1
160+
#chpasswd || true # Overrides 'set -e'
153161
fi
154162
fi
155163

0 commit comments

Comments
 (0)