summaryrefslogtreecommitdiffstats
path: root/lib/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmd')
-rw-r--r--lib/cmd/shell.sh24
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/cmd/shell.sh b/lib/cmd/shell.sh
index 9f5b6ba..c2570e0 100644
--- a/lib/cmd/shell.sh
+++ b/lib/cmd/shell.sh
@@ -24,7 +24,7 @@ use session
cmd_shell_main()
{
local root=
- local uname_s=
+ local session_dir=
if [ ${#} -lt 1 ]; then
print_cmd_usage 'shell' >&2
@@ -37,28 +37,14 @@ cmd_shell_main()
. "${root}/etc/os-release"
profile_set "${ID}"
- uname_s="$( (uname -s) 2>/dev/null)" || uname_s='unknown'
- mkdir -p "${root}/prokit/wd/${$}"
- case "${uname_s}" in
- 'Linux')
- mount -o bind . "${root}/prokit/wd/${$}"
- ;;
- esac
-
- session_begin "${root}" :
+ session_begin "${root}" . :
+ session_dir="/prokit/sessions/$(session_id)"
if [ ${#} -eq 0 ]; then
- chroot "${root}" /bin/sh -c "cd '/prokit/wd/${$}'; /bin/sh"
+ chroot "${root}" /bin/sh -c "cd '${session_dir}'; /bin/sh"
printf '\n'
info "$(get_msg 'cmd_shell_exiting')"
else
- chroot "${root}" /bin/sh -c "cd '/prokit/wd/${$}'; ${*}"
+ chroot "${root}" /bin/sh -c "cd '${session_dir}'; ${*}"
fi
session_end
-
- case "${uname_s}" in
- 'Linux')
- umount "${root}/prokit/wd/${$}"
- ;;
- esac
- rmdir "${root}/prokit/wd/${$}"
}