feat: improve systemd detection with additional fallback checks
This commit is contained in:
parent
014a645a22
commit
85b291a5f8
1 changed files with 3 additions and 3 deletions
4
svc.bash
4
svc.bash
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue