Fix run with --force mode
authorJamie Cameron <jcameron@webmin.com>
Mon, 23 Aug 2010 03:59:44 +0000 (20:59 -0700)
committerJamie Cameron <jcameron@webmin.com>
Mon, 23 Aug 2010 03:59:44 +0000 (20:59 -0700)
status/monitor.pl

index 23d6de8..57337d4 100755 (executable)
@@ -11,12 +11,14 @@ require './status-lib.pl';
 # Check if the monitor should be run now
 @tm = localtime(time());
 if ($ARGV[0] ne "--force") {
-       shift(@ARGV);
        @hours = split(/\s+/, $config{'sched_hours'});
        !@hours || &indexof($tm[2], @hours) >= 0 || exit;
        @days = split(/\s+/, $config{'sched_days'});
        !@days || &indexof($tm[6], @days) >= 0 || exit;
        }
+else {
+       shift(@ARGV);
+       }
 
 # Check for list of monitors to limit refresh to
 %onlycheck = map { $_, 1 } @ARGV;