Merge branch 'release-1.34'

This commit is contained in:
Isaac Connor 2020-11-20 16:39:40 -05:00
commit 0d71b18097
2 changed files with 26 additions and 18 deletions

View File

@ -123,14 +123,19 @@ sub get_service_urls {
); );
if ( $result ) { if ( $result ) {
print "Have results from GetServices\n" if $verbose; print "Have results from GetServices\n" if $verbose;
foreach my $svc ( @{ $result->get_Service() } ) { my $services = $result->get_Service();
my $short_name = $namespace_map{$svc->get_Namespace()}; if ( $services ) {
my $url_svc = $svc->get_XAddr()->get_value(); foreach my $svc ( @{ $services } ) {
if ( defined $short_name && defined $url_svc ) { my $short_name = $namespace_map{$svc->get_Namespace()};
print "Got $short_name service $url_svc\n" if $verbose; my $url_svc = $svc->get_XAddr()->get_value();
$self->set_service($short_name, 'url', $url_svc); if ( defined $short_name && defined $url_svc ) {
} print "Got $short_name service $url_svc\n" if $verbose;
} $self->set_service($short_name, 'url', $url_svc);
}
} # end foreach service
} else {
print "No services from GetServices\n" if $verbose;
} # end if services
} else { } else {
print "No results from GetServices\n" if $verbose; print "No results from GetServices\n" if $verbose;
} }

View File

@ -88,16 +88,19 @@ if [[ -n "$ZM_CONFIG" && ! -f "$ZM_CONFIG" ]]; then
fi fi
# Load zm.conf # Load zm.conf
if [ -n "$ZM_CONFIG" ]; then for zmconf in "$ZM_CONFIG" ./zm.conf /etc/zm.conf /etc/zoneminder/zm.conf; do
echo "Using custom zm.conf $ZM_CONFIG" if [[ -f "$zmconf" ]]; then
source "$ZM_CONFIG" echo "Using $zmconf"
elif [ -f "zm.conf" ]; then source "$zmconf"
echo "Using local zm.conf" # remove filename from path
source "zm.conf" zmconf2="${zmconf%/*}"
elif [ -f "/etc/zm.conf" ]; then # source conf.d
echo "Using system zm.conf" for i in $(find "${zmconf2}/conf.d" -name \*.conf |sort); do . "$i"; done;
source "/etc/zm.conf" break
else fi
done
if [[ -z "$zmconf2" ]]; then
echo -e "Failed locating zoneminder configuration file (zm.conf)\nUse the -z option to specify the full path to the zoneminder configuration file" echo -e "Failed locating zoneminder configuration file (zm.conf)\nUse the -z option to specify the full path to the zoneminder configuration file"
exit 45 exit 45
fi fi