mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-03 17:54:35 +02:00
sms-action: move configuration to global-config
This commit is contained in:
parent
374c9c09ba
commit
95794d0367
2 changed files with 14 additions and 22 deletions
29
sms-action
29
sms-action
|
@ -4,26 +4,11 @@
|
|||
#
|
||||
# run action on received SMS
|
||||
|
||||
:log info ("Received SMS with action '" . $action . "'");
|
||||
# delay a second to give log servers a chance to get the info
|
||||
:global "sms-action";
|
||||
|
||||
:local code ($"sms-action"->$action);
|
||||
:local parsed [ :parse $code ];
|
||||
|
||||
:log info ("Acting on SMS action '" . $action . "': " . $code);
|
||||
:delay 1s;
|
||||
|
||||
: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;
|
||||
}
|
||||
$parsed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue