diff --git a/src/freedombone-installer b/src/freedombone-installer index bd96c6f24ff41ecfdb07f987e4fb1b58fa9393b5..8ce8a817e72fbd1e845603f82331ba3417fc5f70 100755 --- a/src/freedombone-installer +++ b/src/freedombone-installer @@ -38,6 +38,9 @@ INSTALL_STATE_RUNNING_COMMAND=2 INSTALL_STATE_COMMAND_FAIL=3 INSTALL_STATE_COMMAND_SUCCESS=4 +# file containing new password +IMAGE_PASSWORD_FILE=/root/login.txt + install_state=$INSTALL_STATE_FIRST_BOOT CONFIGURATION_FILE="/root/${PROJECT_NAME}.cfg" @@ -495,7 +498,7 @@ function web_admin_setup_login { # if initial setup has not yet happened then create # a password file if ! grep -q 'install_final' "$COMPLETION_FILE"; then - echo -n "$webadmin_password" > /root/login.txt + echo -n "$webadmin_password" > ${IMAGE_PASSWORD_FILE} fi echo -n "$INSTALL_STATE_WEBADMIN_PASSWORD_CTEATED" > "$install_state_file" @@ -1322,6 +1325,7 @@ function webadmin_change_password { sed -i "/${curr_username}:/d" /etc/nginx/.webadminpasswd fi echo -n "$new_password" | htpasswd -i -s -c /etc/nginx/.webadminpasswd "$curr_username" + echo -n "$new_password" > ${IMAGE_PASSWORD_FILE} fi # change the login for the user