From 329cafad4999ac325cb01768d2dd67767e21e65b Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 11 Sep 2019 10:04:18 +0200 Subject: [PATCH] fixed fixed error on stop_downtime --- pandora_server/util/pandora_manage.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 98cca10392..8243053c37 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -4818,6 +4818,25 @@ sub cli_stop_downtime () { my $current_time = time; my $downtime_date_to = get_db_value ($dbh, 'SELECT date_to FROM tplanned_downtime WHERE id=?', $downtime_id); + my $type_execution = get_db_value ($dbh, 'SELECT type_execution FROM tplanned_downtime WHERE id=?', $downtime_id); + + if($type_execution eq 'periodically'){ + + my $downtime_running = get_db_value ($dbh, 'SELECT executed FROM tplanned_downtime WHERE id=?', $downtime_id); + if($downtime_running == 1){ + print_log "[INFO] Planned_downtime '$downtime_name' can't be stopped\n\n"; + exit; + } + } + + + + if($current_time >= $downtime_date_to) { + print_log "[INFO] Planned_downtime '$downtime_name' is already stopped\n\n"; + exit; + } + + if($current_time >= $downtime_date_to) { print_log "[INFO] Planned_downtime '$downtime_name' is already stopped\n\n"; exit;