diff options
author | Kerin Millar <kfm@plushkava.net> | 2024-06-01 01:14:59 +0100 |
---|---|---|
committer | Kerin Millar <kfm@plushkava.net> | 2024-06-11 07:11:59 +0100 |
commit | a3a1544a8631af9e79bddb408c29f2c4f5b1af55 (patch) | |
tree | c9ae590c904b34874205d7846995d11a2ccf3423 | |
parent | test-functions: Clean up the indentation (diff) | |
download | gentoo-functions-a3a1544a8631af9e79bddb408c29f2c4f5b1af55.tar.gz gentoo-functions-a3a1544a8631af9e79bddb408c29f2c4f5b1af55.tar.bz2 gentoo-functions-a3a1544a8631af9e79bddb408c29f2c4f5b1af55.zip |
Add the has_openrc() and has_systemd() functions
Signed-off-by: Kerin Millar <kfm@plushkava.net>
-rw-r--r-- | functions.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh index ec1f339..9736747 100644 --- a/functions.sh +++ b/functions.sh @@ -345,6 +345,24 @@ get_bootparam() ) # +# 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). # is_identifier() |