3 #-------------------------------------------------------------------
4 #procedure to re-install a set of predefined container.
5 #its purpose is to generate 'clean' container over and over
6 #$1 is the file with the container list
7 #$2 base_dir is this application root directory
9 #container list format is
10 # container_name distrinution architecture
11 #-------------------------------------------------------------------
14 #===================================================================
19 LOCKFILE=/var/lock/`basename $0`.$1.lck
21 trap "rm -f $LOCKFILE ; exit 1" 1 2 3 15
22 if (set -C; : > $LOCKFILE) 2> /dev/null ; then
25 echo "Another '`basename $0` $1' is running, existing at once!"
26 echo "remove $LOCKFILE, if it is not the case"
31 #-------------------------------------------------------------------
41 #===================================================================
43 #===================================================================
45 #locking building process
48 if ! [ -f $BASE/etc/vzgot/vzgot_config ] ; then
49 echo "Missing vzgot config file"
50 exit 1 #trouble trouble
52 . $BASE/etc/vzgot/vzgot_config
54 #specific container configuration override (if needed)
55 if [ -f $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config ] ; then
56 $BASE/$VZLIB/vzdir/$CONTNAME/vzgot_config
59 #-------------------------------------------------------------------
60 #is the list file file existing
61 if [ -f $BASE/etc/vzgot/$LIST ] ; then
62 cat $BASE/etc/vzgot/$LIST | sed 's/#.*//g' | grep -v '^[[:space:]]*$' > /tmp/redo.$$
64 while read -r -u 5 CONTNAME REMAINING
66 if [ -f $BASE/$VZLIB/vzdir/$CONTNAME/first.pid ] ; then
67 vzgot shutdown $CONTNAME
68 while [ -f $BASE/$VZLIB/vzdir/$CONTNAME/first.pid ]
73 if [ -d $BASE/$VZLIB/vzdir/$CONTNAME ] ; then
74 vzgot destroy $CONTNAME
76 vzgot.mksrvz $CONTNAME