Schedule script not working for new pppoe clients
Posted: Thu Dec 04, 2014 12:31 am
Hello,
I have a script that I use to read info from PPPOE client list and send it to them via SMS, disable the account etc. And it does not work for newly added clients.
I have simplified the script and added some logging info to it for debugging, the thing is that after reboot everything works, if I add a new PPPOE client when the scheduler runs the script it halts at the :set $lunaclient [:pick [ppp secret get $i comment] 0 2]; line when it reaches that user and does not even finish the script. If i put :set $username [ppp secret get $i name]; as the first line in the for it halts at that one when it reaches the new user.
If I run the script manually it works, if I reboot it works for the new client/s.
The scheduler rule and script have all priviledges enabled.
Models tested on: 951G-2HnD, 951Ui-2HnD, 2011UiAS-2HnD
Firmware: 3.19
Ver: 6.22
For now the solution is to reboot every time I add a new user and I hope someone can help me with another option.
I have a script that I use to read info from PPPOE client list and send it to them via SMS, disable the account etc. And it does not work for newly added clients.
I have simplified the script and added some logging info to it for debugging, the thing is that after reboot everything works, if I add a new PPPOE client when the scheduler runs the script it halts at the :set $lunaclient [:pick [ppp secret get $i comment] 0 2]; line when it reaches that user and does not even finish the script. If i put :set $username [ppp secret get $i name]; as the first line in the for it halts at that one when it reaches the new user.
If I run the script manually it works, if I reboot it works for the new client/s.
The scheduler rule and script have all priviledges enabled.
Models tested on: 951G-2HnD, 951Ui-2HnD, 2011UiAS-2HnD
Firmware: 3.19
Ver: 6.22
Code: Select all
/log info "Startring script";
:global i 0;
:global nrclienti [:len [/ppp secret find]];
:global username 0;
:global password 0;
:global lunaclient 0;
/log info "Finnish define variables";
:for i from=0 to=($nrclienti - 1) do={
/log info "Starting to read client $i info:";
:set $lunaclient [:pick [ppp secret get $i comment] 0 2];
:set $username [ppp secret get $i name];
:set $password [ppp secret get $i password];
/log info "Values read: lunaclient=$lunaclient username=$username password=$password"
}
/log info "End of script";