output message when not doing dbupdate. put quotes in to fix bash error when ZM_DB_HOST is not defined

pull/1207/head
Isaac Connor 2015-12-02 11:17:23 -05:00
parent b8fb711593
commit 70fb6a6786
1 changed files with 3 additions and 1 deletions

View File

@ -17,10 +17,12 @@ if [ "$1" = "configure" ]; then
# Ensure zoneminder is stopped
deb-systemd-invoke stop zoneminder.service || exit $?
if [ $ZM_DB_HOST == "localhost" ]; then
if [ "$ZM_DB_HOST" == "localhost" ]; then
echo 'grant lock tables, create, index, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
# Run the ZoneMinder update tool
zmupdate.pl --nointeractive
else
echo "Not doing database upgrade due to remote db server ($ZM_DB_HOST)"
fi;
fi