diff --git a/src/freedombone-installer b/src/freedombone-installer index f8b6551f8466de5078fb0b3be74a1ed463f598b9..bc4e4718567b707354053811d3fef368d86fa059 100755 --- a/src/freedombone-installer +++ b/src/freedombone-installer @@ -521,6 +521,19 @@ fi # get the current install state 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 + fi + 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 diff --git a/src/freedombone-utils-final b/src/freedombone-utils-final index be60bc100f2fc9cd516c05de8a06c74958dcee39..4fdb0d5c1b439e7b001e496e7e59571bfb24a1c8 100755 --- a/src/freedombone-utils-final +++ b/src/freedombone-utils-final @@ -27,7 +27,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. function install_final { + INSTALL_STATE_RUNNING_COMMAND=2 + INSTALL_STATE_COMMAND_SUCCESS=4 + install_state_file=/root/.install_state.txt + if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then + install_state=$INSTALL_STATE_COMMAND_SUCCESS + echo -n "$INSTALL_STATE_COMMAND_SUCCESS" > "$install_state_file" return fi # unmount any attached usb drive @@ -78,9 +84,6 @@ $(get_ssh_server_key) echo $'Turning off logging' "${PROJECT_NAME}-logging" off --restart - INSTALL_STATE_RUNNING_COMMAND=2 - INSTALL_STATE_COMMAND_SUCCESS=4 - install_state_file=/root/.install_state.txt install_state=$INSTALL_STATE_RUNNING_COMMAND if [ -f "$install_state_file" ]; then install_state=$(cat "$install_state_file")