Hello,
i need a script can do this:
if pppoe-out1 status is connected do no thing
else
disable pppoe-out1
delay 30s
re enable it
thnaks
/interface set disabled=yes [find name=pppoe-out1]
delay 30
/interface set disabled=no [find name=pppoe-out1]
Create several profiles for each pppoe with matching pppoe name inside, u can easy automate it to add via command line..this is not helping because i have more than 80 pppoe-out1-80
so any one disconect will be disconnect all
delay 2
/system script run "pppoe-out1-script"
/system script run "pppoe-out1-script"
##### Script Settings #####
:local WanName "pppoe-out1"
#####################
:local WanStat
/interface pppoe-client monitor $WanName once do={ :set WanStat $status}
:if ($WanStat = "terminating... - failed to authenticate ourselves to peer") do={/system script run "pppoe-out1";}
/interface set disabled=yes [find name=pppoe-out1]
delay 20
/interface set disabled=no [find name=pppoe-out1]
Pardon me but you didn't initially mention that you had multiples to deal with.this is not helping because i have more than 80 pppoe-out1-80
so any one disconect will be disconnect all
If you read the documentation I supplied, you'll find that the on-up and on-down scripts expose a set of client-specific local variables:Thank you very much guys i could do it like this
in profile :
on up :
on down :Code: Select alldelay 2 /system script run "pppoe-out1-script"
in script :Code: Select all/system script run "pppoe-out1-script"
pppoe-out1-script :Code: Select all##### Script Settings ##### :local WanName "pppoe-out1" ##################### :local WanStat /interface pppoe-client monitor $WanName once do={ :set WanStat $status} :if ($WanStat = "terminating... - failed to authenticate ourselves to peer") do={/system script run "pppoe-out1";}
in script :
pppoe-out1 :Code: Select all/interface set disabled=yes [find name=pppoe-out1] delay 20 /interface set disabled=no [find name=pppoe-out1]
its works fine
this is only one user and you can duplicated as much as you want thanks
/interface set disabled=yes [find name=$interface]
delay 20
/interface set disabled=no [find name=$interface]
/interface set disabled=yes [find name=pppoe-out1]
delay 20
/interface set disabled=no [find name=pppoe-out1]