From a3a1544a8631af9e79bddb408c29f2c4f5b1af55 Mon Sep 17 00:00:00 2001 From: Kerin Millar Date: Sat, 1 Jun 2024 01:14:59 +0100 Subject: Add the has_openrc() and has_systemd() functions Signed-off-by: Kerin Millar --- functions.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/functions.sh b/functions.sh index ec1f339..9736747 100644 --- a/functions.sh +++ b/functions.sh @@ -344,6 +344,24 @@ get_bootparam() return 1 ) +# +# Determines whether OpenRC appears to be operational as a service manager in +# the context of the present root filesystem namespace. +# +has_openrc() +{ + test -d /run/openrc +} + +# +# Determines whether systemd appears to be operational as a service manager in +# the context of the present root filesystem namespace. +# +has_systemd() +{ + test -d /run/systemd +} + # # Determines whether the first parameter is a valid identifier (variable name). # -- cgit v1.2.3-65-gdbad