From 2b79839efc9e0dc401b2d611d4177a9c0cf0ce72 Mon Sep 17 00:00:00 2001 From: Bob Mottram <bob@freedombone.net> Date: Sat, 18 Aug 2018 13:40:56 +0100 Subject: [PATCH] Remove app from the removed list --- src/freedombone-installer | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/freedombone-installer b/src/freedombone-installer index 19c69c564..b26b3906e 100755 --- a/src/freedombone-installer +++ b/src/freedombone-installer @@ -43,6 +43,9 @@ install_state=$INSTALL_STATE_FIRST_BOOT CONFIGURATION_FILE="/root/${PROJECT_NAME}.cfg" COMPLETION_FILE="/root/${PROJECT_NAME}-completed.txt" +# file containing a list of removed apps +REMOVED_APPS_FILE=/root/removed + # contains the blocked users and domains FIREWALL_DOMAINS=/root/${PROJECT_NAME}-firewall-domains.cfg @@ -843,10 +846,16 @@ function install_apps_from_webadmin { fi fi + # remove app from the removed file + if ! grep -Fxq "_${app_name}_" "$REMOVED_APPS_FILE"; then + sed -i "/_${app_name}_/d" "$REMOVED_APPS_FILE" + fi + if ! /usr/local/bin/${PROJECT_NAME}-addremove add "${app_name}" > "$webadmin_install_dir/applog.txt"; then sed -i "/$linestr/d" "$pending_installs" web_admin_create_add_apps fi + chown www-data:www-data "$webadmin_install_dir/applog.txt" fi # remove the line @@ -868,6 +877,7 @@ function remove_apps_from_webadmin { if [[ "$linestr" != *'_running'* ]]; then sed -i "s|${app_name}|${app_name}_running|g" "$pending_removes" fi + /usr/local/bin/${PROJECT_NAME}-addremove remove "${app_name}" > "$webadmin_install_dir/applog.txt" web_admin_create_add_apps chown www-data:www-data "$webadmin_install_dir/applog.txt" -- GitLab