nemke
November 18, 2020, 11:01pm
1
I am terible in scripting
I need script to send specific log over SMS
Example
Every 15 days, MT check SIM credit bilans over Ussd codes. So now I like to send that reply over SMS to my number.
After MT sheck SIM credit, in Log i see line “USSD: Your credic is 17Eur”
So now I like just to copy this and send over SMS to my number
Help ?
nemke
November 20, 2020, 8:13pm
2
To be exact I need just BOLD part, how to copy specific massage from log, and make $output to use it like message for Pushpver and SMS
#SCRIPT shows USSD SIM balans and send over SMS &/or Pushover
#SIM Balans check
/interface lte at-chat lte1 input=“AT+CUSD=1,"AAD82CA68A8D1A",15” wait=yes
#Wait 10 sec
:delay 10s
#Define $output. Find Log with word “USSD” Copy all log line message
:global ime;
:set ime “$[/system identity get name]”;
:local startBuf [:toarray [ /log find where message ~“USSD”]];
:local output “$[/log get [:pick $currentBuf] message ]”;
#Send over Pushover
/tool fetch mode=https url=“https://api.pushover.net/1/messages.json ” http-method=post http-data=“token=xxxxxxxxxxxxxxx&user=xxxxxxxxxxxxxxxx&sound=gamelan&priority=0&title=$ime&message=$output” keep-result=no
#Send ove SMS
/tool fetch send sms port=lte1 phone-number=xxxxxxx message=$output
:log info “Report Send”
nemke
November 23, 2020, 8:41pm
3
Anyone have something simular ?