mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-10 10:04:28 +02:00
add script 'sms-action'
This commit is contained in:
parent
c9c87cac41
commit
a6d4e5eec8
2 changed files with 27 additions and 1 deletions
26
sms-action
Normal file
26
sms-action
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# RouterOS script: sms-action
|
||||||
|
# Copyright (c) 2018 Christian Hesse <mail@eworm.de>
|
||||||
|
#
|
||||||
|
# run action on received SMS
|
||||||
|
|
||||||
|
:log info ("Received SMS with action '" . $action . "'");
|
||||||
|
|
||||||
|
:if ($action = "reboot") do={
|
||||||
|
/ system reboot;
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ($action = "shutdown") do={
|
||||||
|
/ system shutdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ($action = "update") do={
|
||||||
|
/ system package update install;
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ($action= "trackon") do={
|
||||||
|
/ system scheduler enable gps-track;
|
||||||
|
}
|
||||||
|
|
||||||
|
:if ($action = "trackoff") do={
|
||||||
|
/ system scheduler disable gps-track;
|
||||||
|
}
|
|
@ -13,7 +13,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
# forward SMS in a loop
|
# forward SMS in a loop
|
||||||
:foreach sms in=[ / tool sms inbox find ] do={
|
:foreach sms in=[ / tool sms inbox find where message~"^([^:][^c][^m][^d][^ ])" ] do={
|
||||||
:local message [ / tool sms inbox get $sms message ];
|
:local message [ / tool sms inbox get $sms message ];
|
||||||
:local phone [ / tool sms inbox get $sms phone ];
|
:local phone [ / tool sms inbox get $sms phone ];
|
||||||
:local timestamp [ / tool sms inbox get $sms timestamp ];
|
:local timestamp [ / tool sms inbox get $sms timestamp ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue