feat: improve systemd detection with additional fallback checks

This commit is contained in:
kake26 2025-05-23 22:07:43 -05:00
parent 014a645a22
commit 85b291a5f8
Signed by: kake26
GPG key ID: E0A989B571D1F99F

View file

@ -3,8 +3,8 @@
# svc.sh - Unified service and package management wrapper for systemd, OpenRC (Devuan), and OpenRC (Alpine) # svc.sh - Unified service and package management wrapper for systemd, OpenRC (Devuan), and OpenRC (Alpine)
# Usage: svc.sh <command> [service|package] # Usage: svc.sh <command> [service|package]
# Detect init system and distribution # Detect init system
if [ -f /run/systemd/system ]; then if [ -f /run/systemd/system ] || command -v systemctl >/dev/null || grep -q systemd /proc/1/comm; then
INIT_SYSTEM="systemd" INIT_SYSTEM="systemd"
elif [ -f /sbin/openrc ]; then elif [ -f /sbin/openrc ]; then
if grep -qi "alpine" /etc/os-release; then if grep -qi "alpine" /etc/os-release; then