ready for tagging
[util-vserver.git] / scripts / convert-vserver-configs
1 #!/bin/bash
2 #
3 # $Id$
4 # Copyright (C) 2007 The Trustees of Princeton University
5 #
6
7 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
8 test -e "$UTIL_VSERVER_VARS" || {
9     echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
10     exit 1
11 }
12 . "$UTIL_VSERVER_VARS"
13
14 for i in $__CONFDIR/*.conf; do
15     if test -r "$i"; then
16         vserver=`echo "$i" | sed "s@$__CONFDIR/@@;s@\.conf@@"`
17         echo "Processing '$vserver'"
18         if ! $_VSERVER "$vserver" convert; then
19             echo "ERROR: '$vserver' could not be converted" >&2
20         fi
21     fi
22 done
23
24 exit 0