2 # Restore the default host configurations
4 # Copyright (C) 2004 Eric Marchionni, Patrik Rayo
5 # Zuercher Hochschule Winterthur
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 2 of the License, or (at your
10 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 DIR=$(dirname `readlink -f $0`)
18 . $DIR/../testing.conf
20 SSHCONF="-F $DIR/../ssh_config"
24 HOSTCONFIGDIR=$DIR/../hosts
25 TESTSDIR=$BUILDDIR/tests
27 [ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
28 [ -d $TESTSDIR/$testname ] || die "Test '$testname' not found"
29 [ -f $TESTSDIR/$testname/test.conf ] || die "File 'test.conf' is missing"
31 . $TESTSDIR/$testname/test.conf
33 if [ -d $TESTSDIR/${testname}/hosts ]
35 for host in `ls $TESTSDIR/${testname}/hosts`
37 eval HOSTLOGIN="root@`echo $HOSTNAMEIPV4 | sed -n -e "s/^.*${host},//gp" | awk -F, '{ print $1 }' | awk '{ print $1 }'`"
38 scp $SSHCONF -r $HOSTCONFIGDIR/${host}/etc $HOSTLOGIN:/ > /dev/null 2>&1
39 scp $SSHCONF -r $HOSTCONFIGDIR/default/etc $HOSTLOGIN:/ > /dev/null 2>&1