diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-06-25 11:03:51 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-06-25 11:03:51 (EDT) |
commit | cfd8ed745a420c8b842610b33f2e2edf8a06e93c (patch) | |
tree | 3fbeeb1fa50b22ca12877912883f93fed8380cbf /src/cmd | |
parent | 4daa379927d395c51086fd2b71a51427b4cd1f20 (diff) |
cmd/shell: Return exit status
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/shell.sh | 8 |
1 files changed, 5 insertions, 3 deletions
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() |