diff options
author | Cem Keylan <cem@ckyln.com> | 2020-05-16 11:53:02 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-05-16 11:53:02 +0300 |
commit | b8b9c52a05f77b72a9ecfcf7d7759b61fa27bf80 (patch) | |
tree | 939e08b8913a77a33a87d52cdb55c071e4c4efe4 /rc.lib | |
parent | 5deb47cfbb7bcd994bb7295637dc5e85187ce1cb (diff) | |
download | init-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.lib | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 +} |