mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
sms-action: move configuration to global-config
This commit is contained in:
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;
|
||||
|
Reference in New Issue
Block a user