mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00: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
|
@ -47,6 +47,13 @@
|
|||
# add mode here...
|
||||
};
|
||||
|
||||
# Run commands on SMS action.
|
||||
:global "sms-action" {
|
||||
shutdown="/ system shutdown";
|
||||
reboot="/ system reboot";
|
||||
# add more here...
|
||||
}
|
||||
|
||||
# This address should resolve ntp servers and is used to update
|
||||
# ntp settings. A pool can rotate servers.
|
||||
:global "ntp-pool" "pool.ntp.org";
|
||||
|
|
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…
Reference in a new issue