From 02343afba734b4a200b222ed10e633648cfe49a8 Mon Sep 17 00:00:00 2001 From: bol-van Date: Fri, 12 Nov 2021 15:13:55 +0300 Subject: [PATCH] install_easy: fake systemd detection --- install_easy.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install_easy.sh b/install_easy.sh index cf7fdde..256be2f 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -25,8 +25,9 @@ DNSCHECK_DIGS=/tmp/digs.txt [ -n "$TPPORT" ] || TPPORT=988 -SYSTEMD_SYSTEM_DIR=/lib/systemd/system -[ -d "$SYSTEMD_SYSTEM_DIR" ] || SYSTEMD_SYSTEM_DIR=/usr/lib/systemd/system +SYSTEMD_DIR=/lib/systemd +[ -d "$SYSTEMD_DIR" ] || SYSTEMD_DIR=/usr/lib/systemd +[ -d "$SYSTEMD_DIR" ] && SYSTEMD_SYSTEM_DIR="$SYSTEMD_DIR/system" ECHON="echo -n" @@ -155,7 +156,8 @@ check_system() local UNAME=$(uname) if [ "$UNAME" = "Linux" ]; then - if [ -x "$SYSTEMCTL" ] ; then + # some distros include systemctl without systemd + if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMD_DIR/systemd" ] && [ -x "$SYSTEMCTL" ]; then SYSTEM=systemd elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then SYSTEM=openwrt