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

Check if install has completed when webadmin daemon starts

parent 94f41ffe
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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