summaryrefslogtreecommitdiffstats
path: root/src/cmd/shell.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/shell.sh')
-rw-r--r--src/cmd/shell.sh8
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()