#!/bin/sh
#
# Copyright (c) 2004 University of Utah and the Flux Group.
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file 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 Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
#

#
# Create some ifcfg-eth files based on a template
#

if [ $# != 1 ]; then
	echo "usage: $0 template-file"
	exit 1
fi

for netif in 0 1 2 3 4 5 6 7 8 9; do
cat > ifcfg-eth${netif} <<FOO
#
# Auto-generated by $0.
# You know the drill: DO NOT EDIT, blah, blah, blah...
#
# ifcfg_eth99 is where the Emulab control net setup takes place,
# it invokes dhclient on all interfaces.  However, dhclient-script
# expects to find an ifcfg_ethN file for each interface it wants to
# probe.  So we put a stub here that does nothing (courtesy of ONBOOT=no).
#
DEVICE="eth${netif}"
ONBOOT="no"

FOO
cat $1 >> ifcfg-eth${netif}
done
