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

Tidying

parent 6603cb49
No related branches found
No related tags found
No related merge requests found
......@@ -1177,12 +1177,28 @@ function after_setup_has_finished {
rm $webadmin_temp_password_file
fi
increment_install_progress
web_admin_onion_only
increment_install_progress
web_admin_create_users
increment_install_progress
web_admin_create_installed_apps
increment_install_progress
web_admin_create_add_apps
increment_install_progress
webadmin_update_version
increment_install_progress
if [ -d /etc/searx ]; then
# new searx secret
if [ -f "/etc/searx/searx/settings.yml" ]; then
......@@ -1196,6 +1212,8 @@ function after_setup_has_finished {
systemctl restart searx
fi
increment_install_progress
# remove default user
if [ -d /home/fbone ]; then
userdel -r fbone
......@@ -1204,13 +1222,19 @@ function after_setup_has_finished {
fi
fi
increment_install_progress
systemctl restart nginx
if [ -f $installer_script ]; then
rm $installer_script
fi
increment_install_progress
regenerate_blocklist
increment_install_progress
chown -R www-data:www-data "$webadmin_install_dir"
enable_webadmin_login
......@@ -1313,14 +1337,17 @@ function remove_apps_from_webadmin {
}
function update_progress_bar {
if [ ! -f "$setup_file" ]; then
return
fi
# shellcheck disable=SC2086
if [ $install_state -ne $INSTALL_STATE_RUNNING_COMMAND ]; then
if [ $install_state -gt $INSTALL_STATE_RUNNING_COMMAND ]; then
return
fi
if [ ! -f /root/.install_counter ]; then
echo -n '1' > /root/.install_counter
fi
max_counter=276
max_counter=286
installing_page="$webadmin_install_dir/setup_installing.html"
progress_counter=$(cat /root/.install_counter)
progress_percent=$((progress_counter * 100 / max_counter))
......@@ -1334,6 +1361,24 @@ function update_progress_bar {
sed -i "s|<div class=\"w3-container.*|<div class=\"w3-container w3-blue w3-round-xlarge\" style=\"width:${progress_percent}%\">${progress_percent}%</div>|g" "$webadmin_install_dir/index.html"
}
function increment_install_progress {
install_comment=$"1"
if [ -f /root/.install_counter ]; then
install_counter=$(cat /root/.install_counter)
else
install_counter=0
fi
if [ "$install_comment" ]; then
echo "$install_comment" > /root/.install_comment
fi
install_counter=$((install_counter + 1))
echo -n "$install_counter" > /root/.install_counter
update_progress_bar
}
function initiate_automatic_backup {
backup_hour=3
if grep -q "BACKUP_HOUR=" "$CONFIGURATION_FILE"; then
......
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