rc: trap CTRL-C for importer, exit gracefully for resuming boot

This commit is contained in:
Franco Fichtner 2017-03-05 16:05:48 +01:00
parent 83b873d4eb
commit e134f0e4f3
2 changed files with 19 additions and 16 deletions

View File

@ -100,7 +100,7 @@ fi
/etc/rc.d/syscons onestart
# run the config importer during early startup
/usr/local/etc/rc.importer -b || exit 1
/usr/local/etc/rc.importer -b
# Enable console output if its muted.
/sbin/conscontrol mute off > /dev/null

View File

@ -27,21 +27,6 @@
INSTALL="/.probe.for.install.media"
MNT="/tmp/hdrescue"
DO_BOOT=
while getopts b OPT; do
case ${OPT} in
b)
DO_BOOT="-b"
shift
;;
*)
echo "Unknown argument during import." >&2
exit 0
;;
esac
done
bootstrap_and_exit()
{
# ensure config directory structure
@ -64,6 +49,24 @@ bootstrap_and_exit()
exit 0
}
trap bootstrap_and_exit 2
DO_BOOT=
while getopts b OPT; do
case ${OPT} in
b)
DO_BOOT="-b"
shift
;;
*)
echo "Unknown argument during import." >&2
bootstrap_and_exit
;;
esac
done
timeout_prompt()
{
OUTPUT=$(echo ${2} | sed 's/./& /g')