mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 08:09:42 +00:00
system: propagate error in rc.syshook scripts #6594
We could stop on first problem but that woul likely break a number of setups that use boot early/start hooks with sloppy coding. Instead make the full run as an error and report it at the end.
This commit is contained in:
parent
72cae559d7
commit
428bc2f4a2
@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# shutdown syshook / plugin scripts
|
||||
/usr/local/etc/rc.syshook stop
|
||||
|
||||
/sbin/shutdown -op now
|
||||
|
||||
@ -59,6 +59,7 @@ if [ ! -d ${SYSDIR}/${SYSLEVEL} ]; then
|
||||
fi
|
||||
|
||||
SYSHOOKS="$(find -s ${SYSDIR}/${SYSLEVEL} -type f})"
|
||||
RETURN=0
|
||||
|
||||
for _SYSHOOK in ${SYSHOOKS}; do
|
||||
SYSHOOK=${_SYSHOOK##"${SYSDIR}/"}
|
||||
@ -69,7 +70,8 @@ for _SYSHOOK in ${SYSHOOKS}; do
|
||||
|
||||
if ! ${_SYSHOOK} "${@}"; then
|
||||
echo ">>> Error in ${SYSLEVEL} script '${SYSNAME}'"
|
||||
RETURN=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
exit ${RETURN}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user