DHCP-Client script: update status during script

Okay, so the actually problem is you want have DHCP Client listen for an address & if it doesn’t get one, after some timeout, then enabled the interface for DHCP Server. That is a bit tricky…

Well, that’s exactly what my startup-script does and it works.
I have decided to not use the dhcp-client script so the AP will define it’s state after reboot only and stay in this config until manually rebooted or turned off/on.

The dhcp-client script would offer the possibility to change the APs config later if at some time for any reason a dhcp-server is present and therefore make itself a “stupid” client again.
You are right about the $bound=0 problem.

However, as I decided to go the way without the dhcp-client script, there is no need to waste your time on my question and it’s OK for me if no one responds anymore.

But if some are interested, I just explain my question again:
As soon the dhcp-client state changes, the script gets triggered. But it can last one second more until an IP-Address is received. So $lease-address is still empty when the script gets started. I tried to start the script with a delay of 5s, so the IP was received. But for the script it is still empty.
For me it seems like that all variables are read out and declared once the script gets started. It would be better if these variables will be read out (or updated) every time in the script when they are used. Or to have the possibility to update it manually.

So I think it’s something like this:
script is triggered because dhcp-client status changed.
:local $bound = 1
:local $lease-address = 0
:local …
…all status variables are declared automatically by the system
:delay 5s … I set a delay to wait for the lease-address to be received

would like to have something like :update $lease-address to re-read the value of the lease-address

:log info (“IP=” .$lease-address) … lease-address is still empty

Kind regards!