#!/bin/sh
#switch_update.sh - originally created to help automate changes to network switches
#		    uses nc (netcat) to stream commands to port 23
#		    can be used to stream anything to any port
#
#Created: 20041028 
#
HOSTLIST="$1"
COMMANDSET="$2"
if [ "$HOSTLIST" = "" -o "$COMMANDSET" = "" ]
then
	echo 
	echo "Usage:  switch_update.sh hostlist commandset"
	echo "hostlist - text file of servers to stream data to"
	echo "commandset - text file of commands to stream"
	echo
	exit
fi
for HOST in `cat $HOSTLIST`
do
	echo "Sending commands to -> $HOST"
	cat $COMMANDSET | nc $HOST 23
done