Awful
[openitg.git] / unchroot.sh
1 #!/bin/sh
2
3 if [ ! "x`whoami`" = "xroot" ]; then
4 echo "$0: you must be root to setup the chroot environment"
5 exit 1;
6 fi
7
8 if [[ ! -d "$1" ]]; then
9 echo "Usage: unchroot.sh path-to-chroot"
10 exit 1;
11 fi
12
13 umount $1/proc && umount $1/sys && umount $1/root/openitg-dev && echo "It is now safe to rm -rf $1" && exit 0;
14
15 cat <<!
16 Error unmounting one of the mounts. You should manually run:
17
18 umount $1/proc
19 umount $1/sys
20 umount $1/root/openitg-dev
21
22 Only after those are safely unmounted can you remove your chroot.
23 !
24 exit 1;
25