mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-11 05:09:40 +02:00
#1298 allow cancel
This commit is contained in:
parent
db83cbe6c4
commit
b1d2ae4528
@ -354,7 +354,7 @@ to protect the seed words. Most users did not set this.
|
||||
" 11 65
|
||||
if [ $? -eq 1 ]; then
|
||||
sudo shred -u /home/admin/.pass.tmp 2>/dev/null
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "Enter extra Password D" /home/admin/.pass.tmp
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "Enter extra Password D" /home/admin/.pass.tmp empty-allowed
|
||||
passwordD=`sudo cat /home/admin/.pass.tmp`
|
||||
sudo shred -u /home/admin/.pass.tmp 2>/dev/null
|
||||
fi
|
||||
|
@ -326,26 +326,30 @@ elif [ "${abcd}" = "x" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# password zero
|
||||
if [ ${#password1} -eq 0 ] && [ "$4" != "empty-allowed" ]; then
|
||||
dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$4" != "empty-allowed" ]; then
|
||||
|
||||
# check that password does not contain bad characters
|
||||
clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ')
|
||||
if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then
|
||||
dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
|
||||
exit 1
|
||||
fi
|
||||
# password zero
|
||||
if [ ${#password1} -eq 0 ]; then
|
||||
dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password cannot be empty\nPlease try again ..." 6 52
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check that password does not contain bad characters
|
||||
clearedResult=$(echo "${password1}" | tr -dc '[:alnum:]-.' | tr -d ' ')
|
||||
if [ ${#clearedResult} != ${#password1} ] || [ ${#clearedResult} -eq 0 ]; then
|
||||
dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Contains bad characters (spaces, special chars)\nPlease try again ..." 6 52
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# password longer than 8
|
||||
if [ ${#password1} -lt 8 ]; then
|
||||
dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# password longer than 8
|
||||
if [ ${#password1} -lt 8 ] && [ "$4" != "empty-allowed" ]; then
|
||||
dialog --backtitle "RaspiBlitz" --msgbox "FAIL -> Password length under 8\nPlease try again ..." 6 52
|
||||
sudo /home/admin/config.scripts/blitz.setpassword.sh x "$2" "$3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# store result is file
|
||||
|
Loading…
x
Reference in New Issue
Block a user