chroot_sandboxes/debian/enter_environment
Jarvis Carroll 3898aa52be remove mounts automatically
Also combined all these little mount and cleanup helpers into one
`cleanup` script with flags.
2025-05-24 00:05:26 +10:00

23 lines
291 B
Bash
Executable File

#!/bin/sh
if test `id -u` -ne 0
then
echo "$0 must be run as root."
return
fi
ROOT=test_environment
if test -e "$ROOT"
then
echo "Using existing environment in $ROOT."
else
./create_environment
fi
./cleanup add_mounts
chroot "$ROOT" sudo -iu user "$@"
./cleanup mounts