#!/bin/sh

# change the default IP address of the LTSP server

FILES=/opt/ltsp/*/etc/lts.conf

if [ ! "$2" ] 
then
	echo
	echo "usage $0 <old IP address> <new IP address>"
	echo
	exit
fi

OLD=$1
NEW=$2

for FILE in $FILES; do
	if [ -f $FILE ]
	then
		perl -i.save -p -e "s/$OLD/$NEW/ ;"  $FILE
	fi
done
