<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote
cite="mid:alpine.LFD.2.20.1512111434540.17670@bofh.nohats.ca"
type="cite">
<blockquote type="cite">Have a look at
/etc/dhcp/dhclient-exit-hooks. The only thing is, when I tried
using it in a very basic way, it triggered every time <br>
the lease was renewed. There may be options only to trigger on
IP change. I stopped looking at that point as my "dynamic IP" is
<br>
virtually static and has not changed in over a year now. <br>
</blockquote>
<br>
I had similar issues with dhclient hooks for my Philips Hue lights
:) <br>
<br>
When I'm coming home, and my phone joins the wifi, and it is dark
and <br>
the lights are off, turn on the lights. However, that also
resulted in <br>
the lights turning on in the middle of night on a DHCP lease
renewal. <br>
<br>
</blockquote>
I've just had a look at <a
href="http://linux.die.net/man/8/dhclient-script">man
dhclient-script</a> and part of it says:<br>
<br>
<blockquote>
<h2>Operation</h2>
When dhclient needs to invoke the client configuration script, it
defines a set of variables in
the environment, and then invokes <b>/sbin/dhclient-script.</b>
In all cases, $reason is set to the name of the reason why the
script has been invoked. The
following reasons are currently defined: MEDIUM, PREINIT, BOUND,
RENEW, REBIND, REBOOT, EXPIRE, FAIL, STOP, RELEASE, NBI and
TIMEOUT.
<br>
</blockquote>
so perhaps intelligent querying of $reason may yield results<br>
<br>
Nick<br>
</body>
</html>