trap transitory exit with debug shell

This commit is contained in:
gh2o 2014-07-20 12:36:51 -07:00
parent f9edb94065
commit aa951dec01
1 changed files with 11 additions and 4 deletions

View File

@ -334,11 +334,11 @@ EOF
}
error_occurred() {
installer_error_occurred() {
log "Error occurred. Exiting."
}
exit_cleanup() {
installer_exit_cleanup() {
log "Cleaning up ..."
set +e
umount /archroot/dev/pts
@ -364,8 +364,8 @@ installer_main() {
exit 1
fi
trap error_occurred ERR
trap exit_cleanup EXIT
trap installer_error_occurred ERR
trap installer_exit_cleanup EXIT
log "Ensuring correct permissions ..."
chmod 0700 "${script_path}"
@ -394,8 +394,15 @@ installer_main() {
}
transitory_exit_occurred() {
# not normally called
log "Error occurred! You're on your own."
exec /bin/bash
}
transitory_main() {
trap transitory_exit_occurred EXIT
if [ "${script_path}" = "/sbin/init" ]; then
# save script
mount -o remount,rw /