Tune up a bit dhclient-script and call the kill state command only once its enough

This commit is contained in:
Ermal 2013-03-07 10:03:09 +00:00
parent eff8ea7dfa
commit 1befdbf866
2 changed files with 2 additions and 2 deletions

View File

@ -1240,7 +1240,7 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg =
// log_error("Checking for old router states: {$g['tmp_path']}/{$realif}_router = {$old_router}");
if (!empty($old_router)) {
log_error("Clearing states to old gateway {$old_router}.");
mwexec("/sbin/pfctl -i {$realif} -Fs; /sbin/pfctl -i {$realif} -Fs -G {$old_router}");
mwexec("/sbin/pfctl -i {$realif} -Fs -G {$old_router}");
}
/* remove interface up file if it exists */

View File

@ -77,7 +77,7 @@ delete_old_states() {
if [ -z "${OLD_ROUTER}" ] && [ -f /tmp/${interface}_router ]; then
OLD_ROUTER = `cat /tmp/${interface}_router`
fi
if [ -n $OLD_ROUTER ]; then
if [ -n "${OLD_ROUTER}" ]; then
$LOGGER "Comparing Routers: Old: ${OLD_ROUTER} New: ${new_routers}"
if [ "${OLD_ROUTER}" != "${new_routers}" ]; then
$LOGGER "Removing states through old gateway '${OLD_ROUTER}' (new gateway '${new_routers}')"