chroot_sandboxes/debian/enter_environment
Jarvis Carroll 28de550295 User setup and erlang installation
A bit fiddly, but this lets us run a realistic erlang install script
from userspace, and then re-enter userspace later without wiping the
installation.
2025-05-23 21:21:16 +10:00

21 lines
266 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
./mountpoints
chroot "$ROOT" sudo -iu user "$@"