diff --git a/src/freedombone-installer b/src/freedombone-installer index fa1c8ece63d77b04e511fcd362d37bd8615cc604..c444da96b0e4d6c7a7fc00295accfd69e80c857b 100755 --- a/src/freedombone-installer +++ b/src/freedombone-installer @@ -543,20 +543,30 @@ if [ -f "$install_state_file" ]; then install_state=$(cat "$install_state_file") # shellcheck disable=SC2086 if [ $install_state -ne $INSTALL_STATE_COMMAND_SUCCESS ]; then - chown www-data:www-data "$webadmin_install_dir/log.txt" - # remove the setup file containing login details - if [ -f "$setup_file" ]; then - rm "$setup_file" - fi - if [ -f /etc/nginx/.webadminpasswd ]; then - rm /etc/nginx/.webadminpasswd + if grep -q 'install_final' "$COMPLETION_FILE"; then + echo -n "$INSTALL_STATE_COMMAND_SUCCESS" > "$install_state_file" + install_state=$INSTALL_STATE_COMMAND_SUCCESS + else + chown www-data:www-data "$webadmin_install_dir/log.txt" + # remove the setup file containing login details + if [ -f "$setup_file" ]; then + rm "$setup_file" + fi + if [ -f /etc/nginx/.webadminpasswd ]; then + rm /etc/nginx/.webadminpasswd + fi + echo -n "$INSTALL_STATE_FIRST_BOOT" > "$install_state_file" + install_state=$INSTALL_STATE_FIRST_BOOT fi + fi +else + if grep -q 'install_final' "$COMPLETION_FILE"; then + echo -n "$INSTALL_STATE_COMMAND_SUCCESS" > "$install_state_file" + install_state=$INSTALL_STATE_COMMAND_SUCCESS + else echo -n "$INSTALL_STATE_FIRST_BOOT" > "$install_state_file" install_state=$INSTALL_STATE_FIRST_BOOT fi -else - echo -n "$INSTALL_STATE_FIRST_BOOT" > "$install_state_file" - install_state=$INSTALL_STATE_FIRST_BOOT fi while true