2015-08-18 02:03:27 +08:00
#! /bin/sh
set -e
if [ "$1" = "configure" ]; then
chown www-data:root /var/log/zm
chown www-data:www-data /var/lib/zm
if [ -z "$2" ]; then
chown www-data:www-data -R /var/cache/zoneminder
fi
2015-11-10 01:34:24 +08:00
# Do this every time the package is installed or upgraded
# Test for database presence to avoid failure of zmupdate.pl
# Ensure zoneminder is stopped
deb-systemd-invoke stop zoneminder.service || exit $?
2015-11-10 01:36:23 +08:00
echo 'grant lock tables, create, index, alter on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql --defaults-file=/etc/mysql/debian.cnf mysql
2015-11-10 01:34:24 +08:00
# Run the ZoneMinder update tool
zmupdate.pl --nointeractive
2015-08-18 02:03:27 +08:00
fi
#DEBHELPER#