2018-08-24 14:16:56 +00:00
|
|
|
#
|
2018-08-06 14:05:34 +00:00
|
|
|
# RouterOS script: sms-action
|
|
|
|
# Copyright (c) 2018 Christian Hesse <mail@eworm.de>
|
|
|
|
#
|
|
|
|
# run action on received SMS
|
|
|
|
|
|
|
|
:log info ("Received SMS with action '" . $action . "'");
|
2018-08-06 20:07:59 +00:00
|
|
|
# delay a second to give log servers a chance to get the info
|
|
|
|
:delay 1s;
|
2018-08-06 14:05:34 +00:00
|
|
|
|
|
|
|
: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;
|
|
|
|
}
|