2 #----------------------------------------------------
3 #shell used to remove the root file system for a
6 #----------------------------------------------------
9 # VE_name is the container dir name
10 # base_dir is this application root directory
11 # used for devel only.
12 #----------------------------------------------------
15 #----------------------------------------------------
16 if ! [ -f $BASE/etc/vzgot/vzgot_config ] ; then
17 echo "Missing vzgot config file"
18 exit 1 #trouble trouble
20 . $BASE/etc/vzgot/vzgot_config
22 #specific container configuration override (if needed)
23 if [ -f $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config ] ; then
24 $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config
26 #----------------------------------------------------
27 if [ ! -d $BASE/$VZLIB/vzdir/$CONTNAME ] ; then
28 echo "Container $CONTNAME not existing"
32 #----------------------------------------------------
33 #checking if container is up and running
34 if [ -f $BASE/$VZLIB/vzdir/$CONTNAME/first.pid ] ; then
35 echo "Container $CONTNAME is up and running"
36 echo "Container must be stop first, try \"vzgot shutdown $CONTNAME\""
39 #----------------------------------------------------
40 if [ ! -z "$LVM" ] ; then
41 VZCONTNAME=`echo $CONTNAME | sed 's/\.//g' | sed 's/-//g'`
42 umount $BASE/$VZLIB/vzdir/$CONTNAME
43 sed -i -e/"vzdir\/$CONTNAME"/d /etc/fstab
44 lvremove --quiet -f /dev/$LVM/$VZCONTNAME > /dev/null 2>&1
46 if [ $ret -ne 0 ]; then
47 echo "vzgot.destroy, unable to destroy LVM $VZCONTNAME with lvremove"
51 mv $BASE/$VZLIB/vzdir/$CONTNAME $BASE/$VZLIB/vzdir/$CONTNAME.$$
52 rm -fr $BASE/$VZLIB/vzdir/$CONTNAME.$$ &