#!/bin/bash

export CMD=`basename $0`
export VERBOSE="true"

. /etc/vhspare/vhspare.conf
. /etc/vhspare/vhspare-functions.sh

# (MAIN)

[ X"$1" == X"-n" ] && {
	echo "(running in dummy mode)" >&2
	export DOIT="echo "
	shift
}

vhspare_run_parts /etc/vhspare/pre-common

echo "
	setup: 	$MYNAME	$MYIP
	role: 	$MYROLE ($MYDESC)
"

exit 0 ################

export NEWROLE=$MYROLE

vhspare_run_parts /etc/vhspare/pre-$MYROLE
vhspare_run_parts /etc/vhspare/post-common
vhspare_run_parts /etc/vhspare/post-$NEWROLE

exit 0
