LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File udhcp-outputpy.patch of Package udhcp (Project openSUSE:Factory)

diff -uNrp udhcp-0.9.8.orig/samples/outputpy.udhcp.sh udhcp-0.9.8/samples/outputpy.udhcp.sh
--- udhcp-0.9.8.orig/samples/outputpy.udhcp.sh	1970-01-01 08:00:00.000000000 +0800
+++ udhcp-0.9.8/samples/outputpy.udhcp.sh	2008-07-29 17:10:12.000000000 +0800
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# outputpy.udhcp.sh: a simple script called by udhcpc when a lease is
+# obtained. The script takes information passed by udhcpc as environment
+# variables and outputs it formatted as a python dict. Only the variables
+# needed by pypxeboot are currently printed: others are listed in comments
+# for reference.
+# Copyright 2007 Trinity College Dublin
+# Author: Stephen Childs <childss@cs.tcd.ie>
+
+# we only need to process "bound" events
+if [ "$1" == "bound" ]; then
+echo ip=$ip
+echo siaddr=$siaddr
+echo sname=$sname
+echo boot_file=$boot_file
+echo subnet=$subnet
+echo timezone=$timezone
+echo router=$router
+echo bootfile=$bootfile #        - The bootfile name
+fi
+exit 0
+
+#        timesvr         - A list of time servers
+#        namesvr 
+#        dns  
+#        logsvr          - A list of MIT-LCS UDP log servers
+#        cookiesvr       - A list of RFC 865 cookie servers
+#        lprsvr          - A list of LPR servers
+#        hostname        - The assigned hostname
+#        bootsize        - The length in 512 octect blocks of the bootfile
+#        domain          - The domain name of the network
+#        swapsvr         - The IP address of the client's swap server
+#        rootpath        - The path name of the client's root disk
+#        ipttl           - The TTL to use for this network
+#        mtu             - The MTU to use for this network
+#        broadcast       - The broadcast address for this network
+#        ntpsrv          - A list of NTP servers
+#        wins            - A list of WINS servers
+#        lease           - The lease time, in seconds
+#        dhcptype        - DHCP message type (safely ignored)
+#        serverid        - The IP of the server
+#        message         - Reason for a DHCPNAK
+#        tftp            - The TFTP server name
diff -uNrp udhcp-0.9.8.orig/Makefile udhcp-0.9.8/Makefile
--- udhcp-0.9.8.orig/Makefile	2008-07-29 17:11:18.000000000 +0800
+++ udhcp-0.9.8/Makefile	2008-07-29 17:20:04.000000000 +0800
@@ -106,6 +106,8 @@ endif
 	$(INSTALL) udhcpd.conf.5 $(USRSHAREDIR)/man/man5
 	mkdir -p $(USRSHAREDIR)/man/man8
 	$(INSTALL) udhcpc.8 udhcpd.8 $(USRSHAREDIR)/man/man8
+	$(INSTALL) samples/outputpy.udhcp.sh $(USRSHAREDIR)/udhcpc/outputpy.udhcp.sh
+	chmod +x $(USRSHAREDIR)/udhcpc/outputpy.udhcp.sh

 clean:
 	-rm -f udhcpd udhcpc dumpleases *.o core