Hello
Little help. Why I need tu run 2 times this script after every reboot, so massage is send over pushover. Only first time (after reboot) I need to run it twice so massage will be send. After first run nothing happen, after second I got report.
RBM11G ver 6.49.5
#Provera stanja kredita preko Ussd koda
/interface lte at-chat lte1 input=“AT+CUSD=1,"AAD82CA68A8D1A",15” wait=yes
#Definisanje promenljive
:global ime;
:global message;
:set ime “$[/system identity get name]”
{
:local x
foreach i in=([/log find where message~“USSD: Kredit je”]) do={
:set $x [/log get $i message]
:set $message ($x)
}
:put $message
} #Pushover
/tool fetch mode=https url=“https://api.pushover.net/1/messages.json” http-method=post http-data=“token=xxxxxxxxxxxxxxxxx&user=xxxxxxxxxxxxxx&sound=gamelan&priority=1&title=$ime&message=$message” keep-result=no
No no. After reboot of device, when I try to run script nothing happen. After I run it again it work. Again, also work. It is not importnat when I try it after reboot (one hour, two, or five) BUT first time don't work. I don't run it to soon so ROS is not up...like you write
First of all, remove all errors, and also unknow language comments.
I do not understand Croatian and I do not know thet the string
“Provera stanja kredita preko Ussd koda” mean “Check the credit balance using the USSD code”
# Check the credit balance using the USSD code
/interface lte at-chat lte1 input="AT+CUSD=1,\"AAD82CA68A8D1A\",15" wait=yes
# Variables definition
:global ime [/system identity get name]
:global message ""
# Kredit je = Credit is
:foreach index in=[/log find where message~"USSD: Kredit je"] do={
:set $message ([/log get $index]->"message")
}
:put $message
# pushover.net
/tool fetch mode=https url="https://api.pushover.net/1/messages.json" http-method=post keep-result=no \
http-data="token=xxxxxxxxxxxxxxxxx&user=xxxxxxxxxxxxxx&sound=gamelan&priority=1&title=$ime&message=$message"
:log warning "Report send..."
:delay 15s
/system reboot