I want to update ddns when my PPPoE on UP.
So I wrote some scripts in the profile (on UP) of the PPPoE.
But the script stopped when running “/tool fetch”.
Is there a bug on that command?
I want to update ddns when my PPPoE on UP.
So I wrote some scripts in the profile (on UP) of the PPPoE.
But the script stopped when running “/tool fetch”.
Is there a bug on that command?
I just tested.
When I run script by [On UP] in PPPoE profiles.
The Owner would be “*sys” instead of “admin”.
Is this the reason that “/tool fetch” cant not work?
Thanks
Maybe you should try to set a flag (global variable) in the on-up script and put your originally intended actions in a scheduled
script that checks the flag. You can schedule it to run as often as you deem necessary (like once per minute).
I want to update the ddns immediately. once my PPPoE IP changed.
Now my alternative method is writing the following script in the on-up script
/system scheduler set [find name=pppoe_run] interval=1sand
run the following script after the ddns was updated.
/system scheduler set [find name=pppoe_run] interval=10mIt can work well and update ddns immediately now.
But I really want to use “/tool fetch” in the on-up script, so that I dont need to write too many extra scripts to prevent DDNS updates too many times during interval=1s scheduler.
Thanks
I guess that is not possible because the on-up script is called at a time the connection is transitioning from down to up and not all actions have been completed.
(e.g. the adding of the default route obtained from PPP has not yet completed)
Having a DDNS entry within a second after PPPoE coming up should be fine.
Thanks for discussing this topic
I tested a 60s delay command like the following picture.
It run well, and show “PPPoE UP start” and “PPPoE UP done” perfectly.
So I guess it is not a transition issue.

Hello,
We've put your script to our PPPoE server and it worked properly.
So you are happy with their solution that causes 5 second delay but not with my solution that causes 1 second delay because you want “immediate”?
Strange…
Actually I just add 1 second delay, it works.
I guess the 1 second is waiting the DNS servic ready to resolve the Domain Name.
If I write a [interval=1s scheduler] , It takes more resources.
I have to write more [if/do/else] command to check whether the IP changed.
and more [if/do/else] command to prevent the same script running at that short time.
On-Up Scripts just run once, and I don’t need to check the IP changed or not.
The only procedure is to update the DDNS.
It is simple and use less resource.
Thanks
You could use something like this to be sure that it will work:
while ([/ping domain_name count=1] != 1) do={:delay 0.2}
Appreciate this is a very old thread, but I was trying to achieve the same thing today - run a script containing /tool fetch from the PPP profile option on-up
I found the script needed to include permission policy=test to use /tool fetch. Then you can set dont-require-permissions=yes to allow the PPP profile to run the script.