Script to create a fresh Debian environment
This commit is contained in:
+28
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user