Files
buildroot/package/openrc/sysv-rcs
Fiona Klute 3e2cc4e46f package/openrc/sysv-rcs: fix shellcheck 0.10 warnings
* Explicitly set shell type. Shellcheck doesn't know OpenRC, but the
  script as such is POSIX shell.
* Override warnings not applicable in context.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
2026-06-17 14:18:29 +02:00

32 lines
698 B
Plaintext
Executable File

#!/sbin/openrc-run
# shellcheck shell=sh
# shellcheck disable=SC2034 # definition for OpenRC
description="start or stop sysv rc[S,K] scripts"
depend() {
after local
}
start() {
for i in /etc/init.d/S??*; do
# Ignore dangling symlinks (if any).
[ -e "$i" ] || continue
einfo "Starting $i"
$i start > /dev/null
eend $?
done
}
stop() {
# we need to reverse the order here, sort -r would be no less fragile
# shellcheck disable=SC2045
for i in $(ls -r /etc/init.d/S??*); do
# Ignore dangling symlinks (if any).
[ -e "$i" ] || continue
einfo "Stopping $i"
$i stop > /dev/null
eend $?
done
}