default interactive to whether we have stdio. So now when running from console it will default to interactive and when running from zmdc.pl will be non-interactive. Do check regardless of ZM_UPDATE_CHECK setting.

This commit is contained in:
Isaac Connor 2022-01-13 10:21:32 -05:00
parent 274ffd7da0
commit 9b8ca69203
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ my $use_log = (($> == 0) || ($> == $web_uid));
logInit( toFile=>$use_log?DEBUG:NOLOG );
logSetSignal();
my $interactive = 1;
my $interactive = -t STDERR; # interactive if we have IO
my $check = 0;
my $freshen = 0;
my $rename = 0;
@ -144,7 +144,7 @@ if ( ($check + $freshen + $rename + $zoneFix + $migrateEvents + ($version?1:0))
pod2usage(-exitstatus => -1);
}
if ($check and ($Config{ZM_CHECK_FOR_UPDATES} or $interactive) ) {
if ($check) {
if (!$interactive) {
Info('Update agent starting at '.strftime('%y/%m/%d %H:%M:%S', localtime() )."\n");
}