Merge pull request #3076 from BlueMax/zmlinkcontent

Honor conf.d (zmlinkcontent.sh)
This commit is contained in:
Isaac Connor 2020-11-11 20:48:05 -05:00 committed by GitHub
commit 52b4c6b089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 10 deletions

View File

@ -88,16 +88,19 @@ if [[ -n "$ZM_CONFIG" && ! -f "$ZM_CONFIG" ]]; then
fi
# Load zm.conf
if [ -n "$ZM_CONFIG" ]; then
echo "Using custom zm.conf $ZM_CONFIG"
source "$ZM_CONFIG"
elif [ -f "zm.conf" ]; then
echo "Using local zm.conf"
source "zm.conf"
elif [ -f "/etc/zm.conf" ]; then
echo "Using system zm.conf"
source "/etc/zm.conf"
else
for zmconf in "$ZM_CONFIG" ./zm.conf /etc/zm.conf /etc/zoneminder/zm.conf; do
if [[ -f "$zmconf" ]]; then
echo "Using $zmconf"
source "$zmconf"
# remove filename from path
zmconf2="${zmconf%/*}"
# source conf.d
for i in $(find "${zmconf2}/conf.d" -name \*.conf |sort); do . "$i"; done;
break
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"
exit 45
fi