#!/bin/sh
oaddr=$1
naddr=$2
echo "Old=$oaddr New=$naddr"
echo "hostname=devIce" > ~/tmp_netcfg.sh
echo "hostaddr=$naddr" >> ~/tmp_netcfg.sh
echo "hostmask=$naddr" >> ~/tmp_netcfg.sh
while : ; do
ans=`ping -W 1 -c 1 $oaddr | grep "1 received" `
if [ "_$ans" != "_" ]; then
  scp ~/tmp_netcfg.sh root@$oaddr:/var/etc/netcfg.sh
  echo "Updated devIce at $oaddr to $naddr"
  break
else
  echo "Awaiting response from $oaddr . Use Cntrl-C to quit"
fi
done
exit
