From 65165e536c3a2ced03df577f223cf4744b053f2b Mon Sep 17 00:00:00 2001 From: bol-van Date: Thu, 18 Nov 2021 18:58:39 +0300 Subject: [PATCH] install_easy: improve systemd detection --- install_easy.sh | 2 +- uninstall_easy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install_easy.sh b/install_easy.sh index d3827a1..031ba26 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -158,7 +158,7 @@ check_system() local UNAME=$(uname) if [ "$UNAME" = "Linux" ]; then # some distros include systemctl without systemd - if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMD_DIR/systemd" ] && [ -x "$SYSTEMCTL" ]; then + if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$(basename $(readlink /proc/1/exe))" = "systemd" ]; then SYSTEM=systemd elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then SYSTEM=openwrt diff --git a/uninstall_easy.sh b/uninstall_easy.sh index 09d9c05..b9f1668 100755 --- a/uninstall_easy.sh +++ b/uninstall_easy.sh @@ -54,7 +54,7 @@ check_system() local UNAME=$(uname) if [ "$UNAME" = "Linux" ]; then # some distros include systemctl without systemd - if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMD_DIR/systemd" ] && [ -x "$SYSTEMCTL" ]; then + if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$(basename $(readlink /proc/1/exe))" = "systemd" ]; then SYSTEM=systemd elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then SYSTEM=openwrt