]>
git.ipfire.org Git - people/amarx/ipfire-2.x.git/blob - src/initscripts/init.d/dhcp
2 # Begin $rc_base/init.d/dhcp
4 # Based on sysklogd script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
6 # Modified for IPFire by Michael Tremer - mitch@ipfire.org
10 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/ethernet
/settings
)
14 iptables
-F DHCPBLUEINPUT
15 if [ -e /var
/ipfire
/dhcp
/enable_green
]; then
16 devices
="${GREEN_DEV}"
18 if [ -e /var
/ipfire
/dhcp
/enable_blue
]; then
19 devices
=+" ${BLUE_DEV}"
21 iptables
-A DHCPBLUEINPUT
-p tcp
--source-port 68 --destination-port 67 -i ${BLUE_DEV} -j ACCEPT
> /dev
/null
2>&1
22 iptables
-A DHCPBLUEINPUT
-p udp
--source-port 68 --destination-port 67 -i ${BLUE_DEV} -j ACCEPT
> /dev
/null
2>&1
25 boot_mesg
"Starting DHCP Server..."
26 loadproc
/usr
/sbin
/dhcpd
-q ${devices}
28 (sleep 20 && chmod 644 /var
/run
/dhcpd.pid
) & # Fix because silly dhcpd creates its pid with mode 640
32 boot_mesg
"Stopping DHCP Server..."
33 killproc
/usr
/sbin
/dhcpd
37 boot_mesg
"Reloading DHCP Server..."
38 reloadproc
/usr
/sbin
/dhcpd
48 statusproc
/usr
/sbin
/dhcpd
52 echo "Usage: $0 {start|stop|reload|restart|status}"
57 # End $rc_base/init.d/dhcp