diff options
Diffstat (limited to 'sms-action')
-rw-r--r-- | sms-action | 27 |
1 files changed, 6 insertions, 21 deletions
@@ -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 -:delay 1s; - -:if ($action = "reboot") do={ - / system reboot; -} - -:if ($action = "shutdown") do={ - / system shutdown; -} +:global "sms-action"; -:if ($action = "update") do={ - / system package update install; -} +:local code ($"sms-action"->$action); +:local parsed [ :parse $code ]; -:if ($action= "trackon") do={ - / system scheduler enable gps-track; -} - -:if ($action = "trackoff") do={ - / system scheduler disable gps-track; -} +:log info ("Acting on SMS action '" . $action . "': " . $code); +:delay 1s; +$parsed; |