aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-01-13 20:19:26 +0300
committerCem Keylan <cem@ckyln.com>2020-01-13 20:19:26 +0300
commit7448b0a31bb899a136157272aa5d9767566ab0cc (patch)
treee8a977430706405a87682e0420724b13d63cfa09
parent829d56ed67ede66c7bff3276c683325a273064dc (diff)
downloadinit-7448b0a31bb899a136157272aa5d9767566ab0cc.tar.gz
remove run_hooks function for sinit option parsing
-rwxr-xr-xrc.boot8
-rw-r--r--rc.lib2
-rwxr-xr-xrc.shutdown14
3 files changed, 13 insertions, 11 deletions
diff --git a/rc.boot b/rc.boot
index 45c8d75..92dbf1b 100755
--- a/rc.boot
+++ b/rc.boot
@@ -154,9 +154,11 @@ out "Loading sysctl settings..."; {
done
}
-out "Running boot hooks..."; {
- run_hooks /etc/init/*.boot
-}
+out "Running boot hooks..."
+set +f
+for file in /etc/init/*.boot ; do
+ [ -f "$file" ] && . "$file"
+done
out "Running rc.local..."; {
[ -r "/etc/init/rc.local" ] && \
diff --git a/rc.lib b/rc.lib
index d37a237..121cc93 100644
--- a/rc.lib
+++ b/rc.lib
@@ -25,5 +25,3 @@ emergency_shell() {
/bin/sh -l
}
-
-run_hooks() { for file in "$@" ; do [ -f "$file" ] && . "$file"; done ;}
diff --git a/rc.shutdown b/rc.shutdown
index 83b6572..9e6d028 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -10,9 +10,10 @@ out "Waiting for services to stop..."; {
sv exit /var/service/*
}
-out "Running pre shutdown hooks..."; {
- run_hooks /etc/init/*.pre.shutdown
-}
+out "Running pre shutdown hooks..."
+for file in /etc/init/*.pre.shutdown ; do
+ [ -f "$file" ] && . "$file"
+done
out "Saving random seed..."; {
dd count=1 bs=512 if=/dev/random of=/var/random.seed
@@ -48,6 +49,7 @@ out "Deactivating dmcrypt devices (if any exist)."; {
}
}
-out "Running post shutdown hooks..."; {
- run_hooks /etc/rc.d/*.post.shutdown
-}
+out "Running post shutdown hooks...";
+for file in /etc/rc.d/*.post.shutdown ; do
+ [ -f "$file" ] && . "$file"
+done