summaryrefslogtreecommitdiffstats
path: root/init_functions
diff options
context:
space:
mode:
Diffstat (limited to 'init_functions')
-rw-r--r--init_functions16
1 files changed, 16 insertions, 0 deletions
diff --git a/init_functions b/init_functions
index 60532d2..1bebf45 100644
--- a/init_functions
+++ b/init_functions
@@ -44,6 +44,22 @@ major_minor_to_device() {
return 1
}
+run_hookfunctions() {
+ local hook fn=$1 desc=$2
+
+ shift 2
+ for hook in "$@"; do
+ [ -x "/hooks/$hook" ] || continue
+
+ unset "$fn"
+ . "/hooks/$hook"
+ type "$fn" >/dev/null || continue
+
+ msg ":: running $desc [$hook]"
+ "$fn"
+ done
+}
+
parse_cmdline() {
local w in_quotes lhs rhs
in_quotes=0