diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-01-24 16:46:48 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-01-24 16:46:48 -0800 |
commit | 9c262c43444441dbbbf5bbccc6dae0583abbdec6 (patch) | |
tree | 29e81f048ade3bc74edbdfe3e6fe62fdd49858bd /scripts/vyatta-dhclient-hook | |
parent | 5c97a19976e400901b06b6784d767925e0893799 (diff) | |
download | vyatta-cfg-9c262c43444441dbbbf5bbccc6dae0583abbdec6.tar.gz vyatta-cfg-9c262c43444441dbbbf5bbccc6dae0583abbdec6.zip |
add script to /etc/dhcp3/dhclient-exit-hooks to store values received by dhclient
Diffstat (limited to 'scripts/vyatta-dhclient-hook')
-rw-r--r-- | scripts/vyatta-dhclient-hook | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/vyatta-dhclient-hook b/scripts/vyatta-dhclient-hook new file mode 100644 index 0000000..cc3cb08 --- /dev/null +++ b/scripts/vyatta-dhclient-hook @@ -0,0 +1,19 @@ + +# To enable this script set the following variable to "yes" +RUN="yes" + +if [ "$RUN" = "yes" ]; then + LOG=/var/lib/dhcp3/dhclient_"$interface"_lease + echo `date` > $LOG + + for i in reason interface new_expiry new_dhcp_lease_time medium \ + alias_ip_address new_ip_address new_broadcast_address \ + new_subnet_mask new_domain_name new_network_number \ + new_domain_name_servers new_routers new_static_routes \ + new_dhcp_server_identifier new_dhcp_message_type \ + old_ip_address old_subnet_mask old_domain_name \ + old_domain_name_servers old_routers \ + old_static_routes; do + echo $i=\'${!i}\' >> $LOG + done +fi |