Merge 9b3092687537af20e36d2256a93f008be4396d74 into c12ae4a8ef3af3ff37b577735ac3717a63149b8c

This commit is contained in:
Jaredy899 2025-02-12 07:47:11 -05:00 committed by GitHub
commit be1585de70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,6 +23,9 @@ startService() {
rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
;;
sv)
"$ESCALATION_TOOL" sv start "$1"
;;
esac
}
@ -34,6 +37,9 @@ stopService() {
rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
;;
sv)
"$ESCALATION_TOOL" sv stop "$1"
;;
esac
}
@ -45,6 +51,11 @@ enableService() {
rc-service)
"$ESCALATION_TOOL" rc-update add "$1"
;;
sv)
"$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/"
printf "%b\n" "${YELLOW}Waiting 5 seconds...${RC}"
sleep 5
;;
esac
}
@ -56,6 +67,9 @@ disableService() {
rc-service)
"$ESCALATION_TOOL" rc-update del "$1"
;;
sv)
"$ESCALATION_TOOL" rm -f "/var/service/$1"
;;
esac
}
@ -64,7 +78,7 @@ startAndEnableService() {
systemctl)
"$ESCALATION_TOOL" "$INIT_MANAGER" enable --now "$1"
;;
rc-service)
rc-service | sv)
enableService "$1"
startService "$1"
;;
@ -79,7 +93,10 @@ isServiceActive() {
rc-service)
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
;;
sv)
"$ESCALATION_TOOL" sv status "$1" >/dev/null 2>&1
;;
esac
}
checkInitManager 'systemctl rc-service'
checkInitManager 'systemctl rc-service sv'