From d7325b15a0949cef77707be5fd0bf864d6338c57 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 07 Oct 2014 20:30:51 -0400 Subject: Merge branch 'feature/sessions' --- (limited to 'lib/cmd/shell.sh') diff --git a/lib/cmd/shell.sh b/lib/cmd/shell.sh index 5c85d7e..dfff07f 100644 --- a/lib/cmd/shell.sh +++ b/lib/cmd/shell.sh @@ -19,12 +19,11 @@ # . use profile -use chroot +use session cmd_shell_main() { local root= - local uname_s= if [ ${#} -lt 1 ]; then print_cmd_usage 'shell' >&2 @@ -37,28 +36,13 @@ 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 - - chroot_mount "${root}" + session_begin "${root}" . : false if [ ${#} -eq 0 ]; then - chroot "${root}" /bin/sh -c "cd '/prokit/wd/${$}'; /bin/sh" + session_exec /bin/sh printf '\n' info "$(get_msg 'cmd_shell_exiting')" else - chroot "${root}" /bin/sh -c "cd '/prokit/wd/${$}'; ${*}" + session_exec "${@}" fi - chroot_umount "${root}" - - case "${uname_s}" in - 'Linux') - umount "${root}/prokit/wd/${$}" - ;; - esac - rmdir "${root}/prokit/wd/${$}" + session_end } -- cgit v0.9.1