diff options
Diffstat (limited to 'lib/session.sh')
-rw-r--r-- | lib/session.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/session.sh b/lib/session.sh index e189277..0a18f68 100644 --- a/lib/session.sh +++ b/lib/session.sh @@ -105,6 +105,20 @@ session_id() return 0 } +session_exec() +{ + local args= + local session_dir= + + args='' + for arg in "${@}"; do + arg="'$(printf '%s\n' "${arg}" | sed "s/'/'\\\\''/g")'" + args="${args} ${arg}" + done + session_dir="/prokit/sessions/${session_id}" + chroot "${session_root}" /bin/sh -c "cd ${session_dir}; ${args}" +} + session_mount() { local fs= |