install_easy: improve systemd detection

This commit is contained in:
bol-van 2021-11-18 18:58:39 +03:00
parent 49027e141f
commit 65165e536c
2 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ check_system()
local UNAME=$(uname) local UNAME=$(uname)
if [ "$UNAME" = "Linux" ]; then if [ "$UNAME" = "Linux" ]; then
# some distros include systemctl without systemd # 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 SYSTEM=systemd
elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then
SYSTEM=openwrt SYSTEM=openwrt

View File

@ -54,7 +54,7 @@ check_system()
local UNAME=$(uname) local UNAME=$(uname)
if [ "$UNAME" = "Linux" ]; then if [ "$UNAME" = "Linux" ]; then
# some distros include systemctl without systemd # 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 SYSTEM=systemd
elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then elif [ -f "/etc/openwrt_release" ] && exists opkg && exists uci ; then
SYSTEM=openwrt SYSTEM=openwrt