--- network-setup.sh 2007/04/22 11:46:47 1 +++ network-setup.sh 2007/12/05 22:53:21 84 @@ -1,13 +1,24 @@ #!/bin/sh -sudo ifconfig ath0 down -#sudo dhclient eth0 -sudo ifconfig eth0 down +if=eth1 +test ! -z "$1" && if=$1 + +echo "setting network on $if" +#sudo ifconfig $if down || exit +sudo killall udhcpd +sudo rm etc/udhcpd.leases +sudo touch etc/udhcpd.leases sleep 1 -sudo ifconfig eth0 192.168.1.100 up -sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 -echo "leaving" -sudo smcroute -l eth0 224.0.0.103 -echo "joining" -sudo smcroute -j eth0 224.0.0.103 +sudo ifconfig $if 10.0.0.100 up +#sudo ifconfig $if:192 192.168.1.241 netmask 255.255.255.240 up +sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev $if netstat -rn +pid=`pidof dhcpd` +if [ -z "$pid" ] ; then + echo "starting bootp server" + sudo /usr/sbin/udhcpd etc/udhcpd.conf +fi +echo "starting tftp server" +pid=`pidof in.tftpd` +test ! -z "$pid" && sudo kill $pid +sudo /usr/sbin/in.tftpd -l -a 10.0.0.100 -s /srv/tftp -B 1468 -v -v