openap-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[openap-cvs] : udhcp/samples sample.script,1.1.1.1,1.2 udhcpd.conf,1.1.1


From: David Kimdon <address@hidden>
Subject: [openap-cvs] : udhcp/samples sample.script,1.1.1.1,1.2 udhcpd.conf,1.1.1.1,1.2
Date: Sun, 19 May 2002 20:42:13 -0400

Update of /cvsroot/openap/udhcp/samples
In directory subversions:/tmp/cvs-serv13752/samples

Modified Files:
        sample.script udhcpd.conf 
Log Message:
make it easier to optionally include server and/or client, remove cruft


Index: sample.script
===================================================================
RCS file: /cvsroot/openap/udhcp/samples/sample.script,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sample.script       8 May 2002 04:41:20 -0000       1.1.1.1
+++ sample.script       20 May 2002 00:42:10 -0000      1.2
@@ -4,4 +4,47 @@
 # common initialization first, especially if more dhcp event notifications
 # are added.
 
-exec /usr/share/udhcpc/default.$1
+NAME="udhcpc"
+RESOLV_CONF="/etc/resolv.conf"
+
+case "$1" in
+  bound|renew)
+
+       while /sbin/route del default gw 0.0.0.0 dev $interface
+       do :
+       done
+
+       [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+       [ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+       /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+
+       if [ -n "$router" ]
+       then
+               for i in $router; do
+                       /sbin/route add default gw $i dev $interface
+               done
+       fi
+
+       echo -n > $RESOLV_CONF
+       [ -n "$domain" ] && echo domain $domain >> $RESOLV_CONF
+       for i in $dns
+       do
+               echo nameserver $i >> $RESOLV_CONF
+       done
+
+       ;;
+  deconfig)
+       echo -n "$NAME handling deconfig event: "
+
+       /sbin/ifconfig $interface 0.0.0.0
+
+       echo "Done."
+       ;;
+  *)
+       echo "Usage: $0 {bound|renew|deconfig}" >&2
+       exit 1
+       ;;
+esac
+
+exit 0

Index: udhcpd.conf
===================================================================
RCS file: /cvsroot/openap/udhcp/samples/udhcpd.conf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- udhcpd.conf 8 May 2002 04:41:20 -0000       1.1.1.1
+++ udhcpd.conf 20 May 2002 00:42:10 -0000      1.2
@@ -2,13 +2,13 @@
 
 # The start and end of the IP lease block
 
-start          192.168.0.20    #default: 192.168.0.20
-end            192.168.0.254   #default: 192.168.0.254
+start          192.168.100.20
+end            192.168.100.254
 
 
 # The interface that udhcpd will use
 
-interface      eth0            #default: eth0
+interface      wlan0           #default: eth0
 
 
 # The maximim number of leases (includes addressesd reserved
@@ -57,7 +57,7 @@
 
 # The location of the leases file
 
-#lease_file    /etc/udhcpd.leases      #defualt: /etc/udhcpd.leases
+lease_file     /var/udhcpd.leases      #defualt: /etc/udhcpd.leases
 
 # The location of the pid file
 #pidfile       /var/run/udhcpd.pid     #default: /var/run/udhcpd.pid
@@ -83,11 +83,10 @@
 # lines. The only option with a default is 'lease'.
 
 #Examles
-opt    dns     192.168.10.2 192.168.10.10
+opt    dns     192.168.0.20 216.148.227.68
 option subnet  255.255.255.0
-opt    router  192.168.10.2
+opt    router  192.168.100.1
 opt    wins    192.168.10.10
-option dns     129.219.13.81   # appened to above DNS servers for a total of 3
 option domain  local
 option lease   864000          # 10 days of seconds
 
@@ -113,4 +112,4 @@
 #lease
 #ntpsrv
 #tftp
-#bootfile
\ No newline at end of file
+#bootfile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]