diff options
author | Kerin Millar <kfm@plushkava.net> | 2024-06-11 06:48:11 +0100 |
---|---|---|
committer | Kerin Millar <kfm@plushkava.net> | 2024-06-14 01:27:44 +0100 |
commit | b56690548449e96d7af3c794434ba89ae0c7fc88 (patch) | |
tree | 80218f99e908edc5abacaa0fec084911c08e8b5c | |
parent | Add the from_portage() function (diff) | |
download | gentoo-functions-b56690548449e96d7af3c794434ba89ae0c7fc88.tar.gz gentoo-functions-b56690548449e96d7af3c794434ba89ae0c7fc88.tar.bz2 gentoo-functions-b56690548449e96d7af3c794434ba89ae0c7fc88.zip |
Add the from_runscript() function
The function determines whether the current shell is executing an OpenRC
runscript, or is a subprocess of one.
Signed-off-by: Kerin Millar <kfm@plushkava.net>
-rw-r--r-- | functions.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh index 8963b12..605aa48 100644 --- a/functions.sh +++ b/functions.sh @@ -316,6 +316,15 @@ from_portage() } # +# Determines whether the current shell is executing an OpenRC runscript, or is +# a subprocess of one. +# +from_runscript() +{ + has_openrc && test "${RC_OPENRC_PID}" +} + +# # Determines whether the kernel cmdline contains the specified parameter as a # component of a comma-separated list specified in the format of gentoo=<list>. # |