Only run zmupdate.pl if the mysql db is located here

pull/1201/head
Isaac Connor 2015-12-20 12:23:40 -05:00
parent 9743bad13f
commit f4debc203d
1 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,8 @@
set -e
. /etc/zm/zm.conf
if [ "$1" = "configure" ]; then
chown www-data:root /var/log/zm
chown www-data:www-data /var/lib/zm
@ -15,9 +17,13 @@ if [ "$1" = "configure" ]; then
# Ensure zoneminder is stopped
deb-systemd-invoke stop zoneminder.service || exit $?
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
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