#!/bin/sh # NEW Ipaddr. = 192.168.3.204 # NEW Mask = 255.255.255.0 # NEW Gateway = 192.168.3.22 # current ifconfig -a: # lo0: flags=19200849 mtu 8232 index 1 # inet 127.0.0.1 netmask ff000000 # hme0: flags=19200843 mtu 1500 index 2 # inet 168.24.10.59 netmask ffffff00 broadcast 168.24.150.255 # ether 0:3:ba:18:97:27 # current (dec 15, 2004) /etc/defaultrouter - 192.168.150.168 # current /etc/hosts: # Internet host table # 127.0.0.1 localhost # 168.24.150.5 dufus loghost # ifconfig -a >> /root/ifconfig.`date +%d%b%y`.before cp /etc/hosts /etc/hosts.`date +%d%b%y` perl -pi -e 's/168.24.10.5/192.168.3.204/g' /etc/hosts cp /etc/defaultrouter /etc/defaultrouter.`date +%d%b%y` perl -pi -e 's/192.168.150.168/192.168.3.22/g' /etc/defaultrouter ifconfig hme0 inet 192.168.3.204 netmask 255.255.255.0 broadcast + ifconfig up hme0 ifconfig -a >> /root/ifconfig.`date +%d%b%y`.after