diff options
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 |