Hi,
I would like to accomplish some tasks based on events. Like create a static DNS record when DHCP allocates an IP address to a newly attached device. I’ve found some scripts to automate that process but these scripts rely on scheduled (repeating) events. Are there also events triggered by the OS which can be used to automate this process as they appear?
Thanks,
Mike
Yes, DHCP server has “lease-script”:
Script that will be executed after lease is assigned or de-assigned. Internal “global” variables that can be used in the script:
leaseBound - set to “1” if bound, otherwise set to “0”
leaseServerName - dhcp server name
leaseActMAC - active mac address
leaseActIP - active IP address
lease-hostname - client hostname
lease-options - array of received options
Netwatch can also trigger scripts.
But in your case DHCP script are the path to take.
Great, thanks for the info.
Is there a complete list of all event-scripts and corresponding (global) variable available?
Mike
Probably not in one place. I know about lease scripts in DHCPv4/6 clients and servers, on up/down scripts in PPP profile, Netwatch, VRRP on master/backup, … I don’t remember any more right now.