Community discussions

MikroTik App
 
viniciusstucki
just joined
Topic Author
Posts: 8
Joined: Thu Nov 29, 2018 2:31 pm

PPP Profile On Up Script dont run

Fri May 06, 2022 5:39 pm

Hello Everyone,

I have a script in system script, that i call from PPP Profile Up and Down Scripts,

It runs from Down Script, but dont runs from Up script call.
The script owner already is *sys as suggested in another topic.

Anyone have a sugestion?

Up Script:
{
:global mensagem "Interface L2TP conectou";
/system script run bot-mensagem
}
Down Script:
{
:global mensagem "Interface L2TP desconetou";
/system script run bot-mensagem
}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PPP Profile On Up Script dont run

Fri May 06, 2022 5:51 pm

obviously you do not post that script and the routeros version used....
 
viniciusstucki
just joined
Topic Author
Posts: 8
Joined: Thu Nov 29, 2018 2:31 pm

Re: PPP Profile On Up Script dont run

Fri May 06, 2022 5:57 pm

Sorry for that! Rextended.

I noticed it after posting.

The script is a Telegram Bot API, the version of ROS is the 6.48.6 ( :shock: 6.49.6 ), also, i've tried it in 7.2.3, same behavior.

The script with sensitive data replaced:
{
:global mensagem;
:local hevento [/system clock get time];
/log info ("$mensagem")
/tool fetch url="https://api.telegram.org/bot<code>/sendMessage\?chat_id=<chat>&text=$hevento $mensagem" keep-result=no
}
Last edited by viniciusstucki on Fri May 06, 2022 6:27 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: PPP Profile On Up Script dont run

Fri May 06, 2022 6:01 pm

Apparenly nothing wrong.

On system script environment, the global variable is updated?

Try to put the script directly inside instead on down script call another script
 
viniciusstucki
just joined
Topic Author
Posts: 8
Joined: Thu Nov 29, 2018 2:31 pm

Re: PPP Profile On Up Script dont run

Fri May 06, 2022 6:05 pm

Apparenly nothing wrong.

On system script environment, the global variable is updated?

Try to put the script directly inside instead on down script call another script
Yes, is there! =(

I've tried running "/tool fetch" directly in On Up, also dont work.
Also, running a simple "/log info ("message")" dont append to log the message...
If i call the script from terminal, with the same text, it works.
 
viniciusstucki
just joined
Topic Author
Posts: 8
Joined: Thu Nov 29, 2018 2:31 pm

Re: PPP Profile On Up Script dont run  [SOLVED]

Fri May 06, 2022 11:14 pm

And now its working..... :?
I made nothing... only disconected from device and take a nap...
Same configurations and same code posted above...

thank for the help @rextended!

Who is online

Users browsing this forum: No registered users and 18 guests