From 1aaf80eff70e423e691868bf35608500fda5bd28 Mon Sep 17 00:00:00 2001 From: deajan Date: Wed, 25 May 2016 19:54:47 +0200 Subject: [PATCH] osync specific changes, no impact on obackup --- install.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 12563c1..56c8e9d 100755 --- a/install.sh +++ b/install.sh @@ -61,13 +61,13 @@ fi if [ -f /sbin/init ]; then if file /sbin/init | grep systemd > /dev/null; then - init=systemd + init="systemd" else - init=init + init="initV" fi else - echo "Can't detect init system." - exit 1 + echo "Can't detect initV or systemd. Service files won't be installed. You can still run $PROGRAM manually or via cron." + init=none fi if [ ! -d "$CONF_DIR" ]; then @@ -129,6 +129,7 @@ if [ -f "./ssh_filter.sh" ]; then fi fi + # OSYNC SPECIFIC if ([ "$init" == "systemd" ] && [ -f "./$OSYNC_SERVICE_FILE_SYSTEMD_SYSTEM" ]); then cp "./$OSYNC_SERVICE_FILE_SYSTEMD_SYSTEM" "$SERVICE_DIR_SYSTEMD_SYSTEM" && cp "./$OSYNC_SERVICE_FILE_SYSTEMD_USER" "$SERVICE_DIR_SYSTEMD_USER/$SERVICE_FILE_SYSTEMD_SYSTEM" @@ -140,7 +141,7 @@ if ([ "$init" == "systemd" ] && [ -f "./$OSYNC_SERVICE_FILE_SYSTEMD_SYSTEM" ]); echo "Can be enabled on boot with [systemctl enable osync-srv@instance.conf]." echo "In userland, active with [systemctl --user start osync-srv@instance.conf]." fi -elif [ -f "./$OSYNC_SERVICE_FILE_INIT" ]; then +elif ( "$init" == "initV" ] && [ -f "./$OSYNC_SERVICE_FILE_INIT" ]); then cp "./$OSYNC_SERVICE_FILE_INIT" "$SERVICE_DIR_INIT" if [ $? != 0 ]; then echo "Cannot copy osync-srv to [$SERVICE_DIR_INIT]." @@ -162,7 +163,7 @@ if ([ "$init" == "systemd" ] && [ -f "./$PMOCR_SERVICE_FILE_SYSTEMD_SYSTEM" ]); echo "Can be activated with [systemctl start pmocr-srv] after configuring file options in [$BIN_DIR/$PROGRAM]." echo "Can be enabled on boot with [systemctl enable pmocr-srv]." fi -elif [ -f "./$PMOCR_SERVICE_FILE_INIT" ]; then +elif ([ "$init" == "initV" ] && [ -f "./$PMOCR_SERVICE_FILE_INIT" ]); then cp "./$PMOCR_SERVICE_FILE_INIT" "$SERVICE_DIR_INIT" if [ $? != 0 ]; then echo "Cannot copy pmoct-srv to [$SERVICE_DIR_INIT]."