What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

udhcpc wrapper?

repvik

New Around Here
I've been trying to get my own DDNS solution running on Merlin, but have so far not been successful.

When udhcpc recieves a lease, it runs /tmp/udhcpc as "a script" that does some magic. Unfortunately, this "script" isn't a script, it's a binary, and I don't know if the source is available.

Would it be possible to replace /tmp/udhcpc with a wrapper script that can execute a script in /jffs/scripts when a new lease is obtained?
(Or, change udhcpc parameters, the -s parameter, to point to a separate script that later runs the /tmp/udhcpc binary)

Eg. something like this:
Code:
#!/bin/sh
if [[ -x "/jffs/scripts/udhcpc-lease" ]]
then
	/jffs/scripts/udhcpc-lease
fi
/tmp/udhcpc $*

Or is there some hook elsewhere that I'm missing?
 
Only hook I know of for trapping dhcp-events are those mentioned in

https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

As I recall there isn't one for the [on-successful lease renewal] per say but "renew" and "bound" may fit your purpose, it may not though as it may get fired regardless of the outcome.


The source for it is available in the git repository.

You may be interested in the information mentioned in the udhcpc readme though I don't know if it's 1000% accurate for current builds but it's a starting point.
 
Last edited:
Only hook I know of for trapping dhcp-events are those mentioned in

https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts

As I recall there isn't one for the [on-successful lease renewal] per say but "renew" and "bound" may fit your purpose, it may not though as it may get fired regardless of the outcome.


The source for it is available in the git repository.

You may be interested in the information mentioned in the udhcpc readme though I don't know if it's 1000% accurate for current builds but it's a starting point.

How did I manage to miss that? The bound event is everything I need, of course. Renew doesn't mean a change in IP, so no change necessary there, and unbound means I don't have network :)

(The information for udhcpc isn't relevant, since udhcpc is run with the parameter -s that overrides the default script. And there is afaik no way to change that without rebuilding)

Thanks a bunch!
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top