aboutsummaryrefslogtreecommitdiff
path: root/rc.lib
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-16 11:53:02 +0300
committerCem Keylan <cem@ckyln.com>2020-05-16 11:53:02 +0300
commitb8b9c52a05f77b72a9ecfcf7d7759b61fa27bf80 (patch)
tree939e08b8913a77a33a87d52cdb55c071e4c4efe4 /rc.lib
parent5deb47cfbb7bcd994bb7295637dc5e85187ce1cb (diff)
downloadinit-b8b9c52a05f77b72a9ecfcf7d7759b61fa27bf80.tar.gz
init: multiple changes
- kill runit services only if sv is available on the system - add run_hook function - add early-boot hook
Diffstat (limited to 'rc.lib')
-rw-r--r--rc.lib9
1 files changed, 9 insertions, 0 deletions
diff --git a/rc.lib b/rc.lib
index 919883e..412f98b 100644
--- a/rc.lib
+++ b/rc.lib
@@ -8,3 +8,12 @@ shell() {
error "Dropping to shell, type 'exit' to continue the boot process."
sh -l
}
+
+run_hook() {
+ out "Running '$1' hooks..."
+ for hook in "/etc/init/"*".$1"; do
+ [ -f "$hook" ] || continue
+ out "Running '$hook'..."
+ . "$hook"
+ done
+}