Add support for /etc/dhclient-exit-hooks file.
Tested by: Max Boyarov <max_b at tut dot by>
This commit is contained in:
parent
1209e08faf
commit
d6790d5a5c
@ -172,6 +172,16 @@ add_new_resolv_conf() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
||||||
|
exit_with_hooks() {
|
||||||
|
exit_status=$1
|
||||||
|
if [ -f /etc/dhclient-exit-hooks ]; then
|
||||||
|
. /etc/dhclient-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Start of active code.
|
# Start of active code.
|
||||||
#
|
#
|
||||||
@ -247,14 +257,14 @@ TIMEOUT)
|
|||||||
fi
|
fi
|
||||||
add_new_routes
|
add_new_routes
|
||||||
if add_new_resolv_conf; then
|
if add_new_resolv_conf; then
|
||||||
exit 0
|
exit_with_hooks 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
ifconfig $interface inet -alias $new_ip_address $medium
|
ifconfig $interface inet -alias $new_ip_address $medium
|
||||||
delete_old_routes
|
delete_old_routes
|
||||||
exit 1
|
exit_with_hooks 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit 0
|
exit_with_hooks 0
|
||||||
|
Loading…
Reference in New Issue
Block a user