From 85b291a5f89db21393bdfa8cfa181a3e11dd2dad Mon Sep 17 00:00:00 2001 From: kake26 Date: Fri, 23 May 2025 22:07:43 -0500 Subject: [PATCH] feat: improve systemd detection with additional fallback checks --- svc.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svc.bash b/svc.bash index 43a6a59..190cf70 100755 --- a/svc.bash +++ b/svc.bash @@ -3,8 +3,8 @@ # svc.sh - Unified service and package management wrapper for systemd, OpenRC (Devuan), and OpenRC (Alpine) # Usage: svc.sh [service|package] -# Detect init system and distribution -if [ -f /run/systemd/system ]; then +# Detect init system +if [ -f /run/systemd/system ] || command -v systemctl >/dev/null || grep -q systemd /proc/1/comm; then INIT_SYSTEM="systemd" elif [ -f /sbin/openrc ]; then if grep -qi "alpine" /etc/os-release; then @@ -136,4 +136,4 @@ case "$1" in echo "Usage: $0 {start|stop|enable|disable|status|list|install|remove|update|search} [service|package]" exit 1 ;; -esac +esac \ No newline at end of file