From cfd8ed745a420c8b842610b33f2e2edf8a06e93c Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 25 Jun 2020 11:03:51 -0400 Subject: cmd/shell: Return exit status --- (limited to 'src') diff --git a/src/cmd/shell.sh b/src/cmd/shell.sh index 0c5a7b0..2cc53ad 100644 --- a/src/cmd/shell.sh +++ b/src/cmd/shell.sh @@ -22,6 +22,7 @@ cmd_shell_main() { local root= local dev= + local es= if [ ${#} -lt 1 ]; then print_cmd_usage 'shell' >&2 @@ -48,18 +49,19 @@ cmd_shell_main() [ "x${dev}" != 'x' ] && block_umount "${root}" return 2 fi + es=0 if [ ${#} -eq 0 ]; then - session_exec /bin/sh + session_exec /bin/sh || es=${?} printf '\n' info "$(get_msg 'cmd_shell_exiting')" else - session_exec "${@}" + session_exec "${@}" || es=${?} fi session_end [ "x${dev}" != 'x' ] && block_umount "${root}" - return 0 + return ${es} } cmd_shell_register() -- cgit v0.9.1