Printing out an errormessage and quitting is easier if there's a function
to call. If the script calling die has exit trapped, like in init, the
emergency_shell is automatically called.
for f in "/$1"/*.sh; do [ -f "$f" ] && . "$f"; done
}
+die() {
+ printf "FATAL: $1\n"
+ printf "Refusing to continue\n"
+ exit 1
+}
+
check_occurances() {
# Count the number of times the character $ch occurs in $str
# Return 0 if the count matches the expected number, 1 otherwise
if [ -n "$root" -a -z "${root%%error:*}" ]; then
case "${root%%:*}" in
- '') echo "FATAL: no root= option specified, and no network support" ;;
- error) echo "FATAL: ${root#error:}" ;;
+ '') die "No root= option specified, and no network support" ;;
+ error) die "${root#error:}" ;;
esac
- emergency_shell
fi
# Network root scripts may need updated root= options,