diff --git a/install.sh b/install.sh index ee428b0..3ed5659 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ CONF_DIR=$FAKEROOT/etc/$PROGRAM BIN_DIR="$FAKEROOT/usr/local/bin" -SERVICE_DIR_INIT=$FAKEROOT/etc/init.d +SERVICE_DIR_INIT=$FAKEROOT/etc/rc.d/init.d # Should be /usr/lib/systemd/system, but /lib/systemd/system exists on debian & rhel / fedora SERVICE_DIR_SYSTEMD_SYSTEM=$FAKEROOT/lib/systemd/system SERVICE_DIR_SYSTEMD_USER=$FAKEROOT/etc/systemd/user @@ -176,7 +176,7 @@ function GetConfFileValue () { } function SetLocalOSSettings { - USER=root + #USER=root # LOCAL_OS and LOCAL_OS_FULL are global variables set at GetLocalOS @@ -329,6 +329,7 @@ function CopyProgram { } function CopyServiceFiles { + init="systemd" if ([ "$init" == "systemd" ] && [ -f "$SCRIPT_PATH/$SERVICE_FILE_SYSTEMD_SYSTEM" ]); then CopyFile "$SCRIPT_PATH" "$SERVICE_DIR_SYSTEMD_SYSTEM" "$SERVICE_FILE_SYSTEMD_SYSTEM" "" "" "" true if [ -f "$SCRIPT_PATH/$SERVICE_FILE_SYSTEMD_SYSTEM_USER" ]; then @@ -339,7 +340,9 @@ function CopyServiceFiles { QuickLogger "Can be activated with [systemctl start SERVICE_NAME@instance.conf] where instance.conf is the name of the config file in $CONF_DIR." QuickLogger "Can be enabled on boot with [systemctl enable $SERVICE_NAME@instance.conf]." QuickLogger "In userland, active with [systemctl --user start $SERVICE_NAME@instance.conf]." - elif ([ "$init" == "initV" ] && [ -f "$SCRIPT_PATH/$SERVICE_FILE_INIT" ] && [ -d "$SERVICE_DIR_INIT" ]); then + fi + init="initV" + if ([ "$init" == "initV" ] && [ -f "$SCRIPT_PATH/$SERVICE_FILE_INIT" ] && [ -d "$SERVICE_DIR_INIT" ]); then CopyFile "$SCRIPT_PATH" "$SERVICE_DIR_INIT" "$SERVICE_FILE_INIT" "755" "" "" true QuickLogger "Created osync-srv service in [$SERVICE_DIR_INIT]."