From b6831fb8ff6091d4c7ddd3c93acdb4b006bd11e7 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 13 Jan 2020 22:43:51 +0200 Subject: [PATCH] init: Remove run_hooks(). Fixes #7 --- lib/init/rc.boot | 4 +++- lib/init/rc.lib | 6 ------ lib/init/rc.shutdown | 8 ++++++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/init/rc.boot b/lib/init/rc.boot index 5177f35..0542a78 100755 --- a/lib/init/rc.boot +++ b/lib/init/rc.boot @@ -151,7 +151,9 @@ log "Loading sysctl settings..."; { } log "Running rc.d hooks..."; { - run_hooks /etc/rc.d/*.boot + for file in /etc/rc.d/*.boot; do + [ -f "$file" ] && . "$file" + done } command -v udevd >/dev/null && diff --git a/lib/init/rc.lib b/lib/init/rc.lib index c6a504f..73e38e9 100644 --- a/lib/init/rc.lib +++ b/lib/init/rc.lib @@ -45,9 +45,3 @@ killall5_sh() { kill -s SIGCONT -1 } - -run_hooks() { - [ -f "$1" ] && for file in "$@"; do - [ -f "$file" ] && . "$file" - done -} diff --git a/lib/init/rc.shutdown b/lib/init/rc.shutdown index e249e7b..ba3049a 100755 --- a/lib/init/rc.shutdown +++ b/lib/init/rc.shutdown @@ -10,7 +10,9 @@ log "Loading rc.conf settings..."; { } log "Running shutdown pre hooks..."; { - run_hooks /etc/rc.d/*.pre.shutdown + for file in /etc/rc.d/*.pre.shutdown; do + [ -f "$file" ] && . "$file" + done } log "Waiting for services to stop..."; { @@ -50,5 +52,7 @@ log "Deactivating dmcrypt devices (if any exist)."; { } log "Running shutdown post hooks..."; { - run_hooks /etc/rc.d/*.post.shutdown + for file in /etc/rc.d/*.post.shutdown; do + [ -f "$file" ] && . "$file" + done }