From 266fa0d97fc612bb413bd9ddafdc8df292ae5d72 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Mon, 20 Jan 2025 14:49:11 +0100 Subject: [PATCH] Reapply #267 to common install script --- dev/common_install.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/dev/common_install.sh b/dev/common_install.sh index 217b937..a57877c 100644 --- a/dev/common_install.sh +++ b/dev/common_install.sh @@ -10,7 +10,7 @@ PROGRAM_BINARY=$PROGRAM".sh" PROGRAM_BATCH=$PROGRAM"-batch.sh" SSH_FILTER="ssh_filter.sh" -SCRIPT_BUILD=2023061101 +SCRIPT_BUILD=2025012001 INSTANCE_ID="installer-$SCRIPT_BUILD" ## osync / obackup / pmocr / zsnap install script @@ -332,14 +332,22 @@ function RemoveAll { else Logger "Skipping removal of [$BIN_DIR/$SSH_FILTER] because other programs present that need it." "NOTICE" fi - RemoveFile "$SERVICE_DIR_SYSTEMD_SYSTEM/$SERVICE_FILE_SYSTEMD_SYSTEM" - RemoveFile "$SERVICE_DIR_SYSTEMD_USER/$SERVICE_FILE_SYSTEMD_USER" - RemoveFile "$SERVICE_DIR_INIT/$SERVICE_FILE_INIT" - - RemoveFile "$TARGET_HELPER_SERVICE_DIR_SYSTEMD_SYSTEM/$SERVICE_FILE_SYSTEMD_SYSTEM" - RemoveFile "$TARGET_HELPER_SERVICE_DIR_SYSTEMD_USER/$SERVICE_FILE_SYSTEMD_USER" - RemoveFile "$TARGET_HELPER_SERVICE_DIR_INIT/$SERVICE_FILE_INIT" + # Try to uninstall every possible service file + if [ $init == "systemd" ]; then + RemoveFile "$SERVICE_DIR_SYSTEMD_SYSTEM/$SERVICE_FILE_SYSTEMD_SYSTEM" + RemoveFile "$SERVICE_DIR_SYSTEMD_USER/$SERVICE_FILE_SYSTEMD_USER" + RemoveFile "$SERVICE_DIR_SYSTEMD_SYSTEM/$TARGET_HELPER_SERVICE_FILE_SYSTEMD_SYSTEM" + RemoveFile "$SERVICE_DIR_SYSTEMD_USER/$TARGET_HELPER_SERVICE_FILE_SYSTEMD_USER" + elif [ $init == "initV" ]; then + RemoveFile "$SERVICE_DIR_INIT/$SERVICE_FILE_INIT" + RemoveFile "$SERVICE_DIR_INIT/$TARGET_HELPER_SERVICE_FILE_INIT" + elif [ $init == "openrc" ]; then + RemoveFile "$SERVICE_DIR_OPENRC/$SERVICE_FILE_OPENRC" + RemoveFile "$SERVICE_DIR_OPENRC/$TARGET_HELPER_SERVICE_FILE_OPENRC" + else + Logger "Can uninstall only from initV, systemd or openRC." "WARN" + fi Logger "Skipping configuration files in [$CONF_DIR]. You may remove this directory manually." "NOTICE" }