mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #1421 from pi-hole/fix/accidental-password-reset
Add option to enter new password as command arg
This commit is contained in:
commit
a290e01bdf
1 changed files with 15 additions and 9 deletions
|
@ -88,17 +88,23 @@ SetWebPassword(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -s -p "Enter New Password (Blank for no password): " PASSWORD
|
if (( ${#args[2]} > 0 )) ; then
|
||||||
echo ""
|
readonly PASSWORD="${args[2]}"
|
||||||
|
readonly CONFIRM="${PASSWORD}"
|
||||||
|
else
|
||||||
|
read -s -p "Enter New Password (Blank for no password): " PASSWORD
|
||||||
|
echo ""
|
||||||
|
|
||||||
if [ "${PASSWORD}" == "" ]; then
|
if [ "${PASSWORD}" == "" ]; then
|
||||||
change_setting "WEBPASSWORD" ""
|
change_setting "WEBPASSWORD" ""
|
||||||
echo "Password Removed"
|
echo "Password Removed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
read -s -p "Confirm Password: " CONFIRM
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
read -s -p "Confirm Password: " CONFIRM
|
|
||||||
echo ""
|
|
||||||
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
|
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
|
||||||
hash=$(HashPassword ${PASSWORD})
|
hash=$(HashPassword ${PASSWORD})
|
||||||
# Save hash to file
|
# Save hash to file
|
||||||
|
|
Loading…
Reference in a new issue