From d0af0804a0c6994dd0024f1331f34e123e02a3d0 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Sun, 11 Jun 2023 11:24:38 +0200 Subject: [PATCH] Fix systemd detection on windows --- dev/common_install.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dev/common_install.sh b/dev/common_install.sh index 6f57262..217b937 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=2020112901 +SCRIPT_BUILD=2023061101 INSTANCE_ID="installer-$SCRIPT_BUILD" ## osync / obackup / pmocr / zsnap install script @@ -80,15 +80,26 @@ function SetLocalOSSettings { } function GetInit { + init="none" if [ -f /sbin/openrc-run ]; then init="openrc" Logger "Detected openrc." "NOTICE" + elif [ -f /usr/lib/systemd/systemd ]; then + init="systemd" + Logger "Detected systemd." "NOTICE" elif [ -f /sbin/init ]; then - if file /sbin/init | grep systemd > /dev/null; then - init="systemd" - Logger "Detected systemd." "NOTICE" + if type -p file > /dev/null 2>&1; then + if file /sbin/init | grep systemd > /dev/null; then + init="systemd" + Logger "Detected systemd." "NOTICE" + else + init="initV" + fi else init="initV" + fi + + if [ $init == "initV" ]; then Logger "Detected initV." "NOTICE" fi else