From 54bff42fa07dbecddfea37efedf089394a0ab2c7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 1 Jan 2016 21:27:30 -0500 Subject: [PATCH] Remove warnings when no server set --- scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in | 1 + scripts/zmpkg.pl.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in index 3998f650d..c3bc792aa 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in @@ -114,6 +114,7 @@ BEGIN my $result = $sth->fetchrow_hashref(); $Config{ZM_SERVER_ID} = $$result{Id}; } + $Config{ZM_SERVER_ID} = undef; } } diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in index be563118b..183f8084c 100644 --- a/scripts/zmpkg.pl.in +++ b/scripts/zmpkg.pl.in @@ -226,7 +226,7 @@ if ( $command =~ /^(?:start|restart)$/ ) zmMemTidy(); runCommand( "zmdc.pl startup" ); - Info( "Starting up services for server $Config{ZM_SERVER_ID}\n" ); + Info( "Starting up services" . ( $Config{ZM_SERVER_ID} ? " for server $Config{ZM_SERVER_ID}\n" : "\n" ) ); my $sql = $Config{ZM_SERVER_ID} ? 'SELECT * FROM Monitors WHERE ServerId=?' : 'SELECT * FROM Monitors'; my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );