Skip to content
Snippets Groups Projects
Commit 1ae64505 authored by Bob Mottram's avatar Bob Mottram
Browse files

Check that password gets generated

parent a0703080
No related branches found
No related tags found
No related merge requests found
......@@ -781,6 +781,9 @@ function web_admin_setup_login {
wait_for_enough_entropy
if [ -f /usr/share/dict/words ]; then
webadmin_password=$(diceware)
if [ ! "$webadmin_password" ]; then
webadmin_password="$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 10 ; echo -n '')"
fi
else
webadmin_password="$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 10 ; echo -n '')"
fi
......
......@@ -110,8 +110,12 @@ function enforce_good_passwords {
function create_password {
wait_for_enough_entropy
#openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c "${1}" ; echo -n ''
diceware
newpass=$(diceware)
if [ "$newpass" ]; then
echo "$newpass"
else
openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c "${1}" ; echo -n ''
fi
}
# NOTE: deliberately no exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment