#!/bin/sh
############################################################################
###    (C)opyright 2003 - 2008 RIPE NCC
###    This file is part of DNSMon
###
###    DNSMon is free software: you can redistribute it and/or modify
###    it under the terms of the GNU General Public License as published by
###    the Free Software Foundation, either version 3 of the License, or
###    (at your option) any later version.
###
###    DNSMon is distributed in the hope that it will be useful,
###    but WITHOUT ANY WARRANTY; without even the implied warranty of
###    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
###    GNU General Public License for more details.
###
###    You should have received a copy of the GNU General Public License
###    along with DNSMon.  If not, see <http://www.gnu.org/licenses/>.
############################################################################

#
# $Id: download-from-testboxes,v 1.1.4.1 2008/04/13 15:49:48 ruben Exp $
#
# sync all files in /data/dns/ on the testboxes to /path/to/data
# 
# this is a temporary task and will be taken over by ttmcd/ttmsd when they 
# are mature
#

 
for HOST in $HOSTLIST_IPV6 ; do
	if fping $HOST 2>&1 > /dev/null; then 
		/usr/local/bin/rsync --timeout=60 -a -e "/usr/local/bin/ssh -C -i $HOME/.ssh/ssh_nsmd_user_key -l nsmd_user" $HOST:/data/dns/DNS* /path/to/data/ > /dev/null 2>&1
#	else
#		echo "$HOST: unreachable"
	fi
done

for HOST in $HOSTLIST_IPV6; do
	if fping $HOST 2>&1 > /dev/null; then 
		/usr/local/bin/rsync --timeout=60 -a -e "/usr/local/bin/ssh -C -i $HOME/.ssh/ssh_nsmd_user_key -l nsmd_user" $HOST:/data/dns6/DNS6* /path/to/data/ > /dev/null 2>&1
#	else
#		echo "$HOST: unreachable"
	fi
done
