diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-01-19 13:20:43 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-01-19 13:20:43 (GMT) |
commit | 57c708218fc8384acefd942e38d54bad881f53d7 (patch) | |
tree | 98b6605dc3f4edd10021adbf4ce6d98ac9b44da2 /mode-watch.lua | |
parent | f940c6741d6e7c8fcc682d733a15ca7aecd46ddc (diff) |
improved mail output at mode_watch.lua
active channel of both system is now watched
Diffstat (limited to 'mode-watch.lua')
-rw-r--r-- | mode-watch.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mode-watch.lua b/mode-watch.lua index 05d3567..abea7b9 100644 --- a/mode-watch.lua +++ b/mode-watch.lua @@ -47,7 +47,7 @@ function send_mail(address, subject, bodytext) fp:close() end -current_mode = "master" +current_mode = nil function process_cmd(message) log.printf(log.DEBUG, "received message: '%s'", message) @@ -72,8 +72,13 @@ function process_cmd(message) if(new_mode and new_mode ~= current_mode) then log.printf(log.NOTICE, "mode is now " .. new_mode) - send_mail("logs@helsinki.at", "[RHCTL] mode changed to " .. new_mode, - "RHCTL just switched from " .. current_mode .. " to " .. new_mode) + if(current_mode == nil) then + send_mail("logs@helsinki.at", "[RHCTL] (re)started mode is now " .. new_mode, + "RHCTL just (re)started current mode is " .. new_mode) + else + send_mail("logs@helsinki.at", "[RHCTL] mode changed to " .. new_mode, + "RHCTL just switched from " .. current_mode .. " to " .. new_mode) + end current_mode = new_mode end |