Script to create a fresh Debian environment

This commit is contained in:
Jarvis Carroll
2025-05-23 13:42:14 +10:00
commit c29250e550
4 changed files with 97 additions and 0 deletions
Vendored Executable
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
if test `id -u` -ne 0
then
echo "$0 must be run as root."
return
fi
ROOT=test_environment
cleanup_mount() {
if mountpoint "$1" > /dev/null
then
echo "Unmounting $1"
umount "$1"
fi
}
if test -e "$ROOT"
then
cleanup_mount "$ROOT/proc"
cleanup_mount "$ROOT/sys"
echo "Removing $ROOT"
rm -r "$ROOT"
else
echo "No environment found at $ROOT. Doing nothing."
fi