Fix webif dhcp display.

Fix dhcpd.exe if no lease get.
This commit is contained in:
Arne Fitzenreiter
2009-12-23 10:13:57 +01:00
parent 8d48e8ea48
commit 21d1c72efc
2 changed files with 23 additions and 25 deletions

View File

@@ -16,7 +16,7 @@
eval $(/usr/local/bin/readhash /var/ipfire/dns/settings)
create_dhcpcd_info()
dhcpcd_up()
{
set | grep "^new_" | sed "s|^new_||g" | \
sort > /var/ipfire/dhcpc/dhcpcd-$interface.info
@@ -64,15 +64,18 @@ create_dhcpcd_info()
fi
}
remove_dhcpcd_info()
dhcpcd_down()
{
rm -f /var/ipfire/dhcpc/dhcpcd-$interface.info
logger -p local0.info -t dhcpcd.exe[$$] "${interface} has been brought down"
rm -f /var/ipfire/red/active
run_subdir ${rc_base}/init.d/networking/red.down/
set | grep "^new_" | sed "s|^new_||g" | \
sort > /var/ipfire/dhcpc/dhcpcd-$interface.info
if [ "$interface" != "red0.8" ]; then
logger -p local0.info -t dhcpcd.exe[$$] "${interface} has been brought down"
rm -f /var/ipfire/red/active
run_subdir ${rc_base}/init.d/networking/red.down/
fi
}
case "$reason" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) create_dhcpcd_info;;
PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) remove_dhcpcd_info;;
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) dhcpcd_up;;
PREINIT|EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP) dhcpcd_down;;
esac