#!/usr/local/bin/bash
#
# note: per host directories are assumed to exist, because per-dir
# Defaults file must be correct and is produced manually.
# This script makes the ports.* files for switch/router ports.
# It uses Jon Snyder's modified listports app to do so.
#
# 3 possible sets of communities:
# 1. oit
# 2. cecs
# 3. public (may not be in use)
LP="./cricket/util/listports.jrb"
HOME="/usr/home/cricket"
TARGET="config/switch-ports"
#TARGET="config.test/switch-ports"
COMMUNITY="XXX"

for HOST in \
	eb112a.seas.pdx.edu \
	eb212a.seas.pdx.edu eb240a.seas.pdx.edu \
	eb312a.seas.pdx.edu eb340a.seas.pdx.edu \
	eb412a.seas.pdx.edu eb440a.seas.pdx.edu \
	eb512a.seas.pdx.edu eb540a.seas.pdx.edu
do
	$LP $HOST $COMMUNITY > /tmp/ports.$HOST
#	cp /tmp/ports.$HOST config/switch-ports/$HOST/ports.$HOST
#	rm -f /tmp/ports.$HOST
	#./cricket/compile
	#./cricket/collector /switch-ports/$HOST
done
