install_db() { . /etc/systemconfig if [ $SystemType = Master_backend -o $SystemType = Standalone ] then mysql -e "use zm" > /dev/null rc=$? if [ $rc = 1 ] then echo "Installing zoneminder database zm" cat /usr/share/zoneminder/db/zm_create.sql | mysql echo 'grant lock tables, alter,select,insert,update,delete on zm.* to 'zmuser'@localhost identified by "zmpass";' | mysql fi else echo "Will only init the database for StandAlone or Master_backend LinHES systems" fi } post_install() { systemd-tmpfiles --create zoneminder.conf #---LinHES Stuff usermod -G video http install_db gen_light_include.py /sbin/sv hup /service/lighttpd #--- } post_upgrade() { post_install /usr/bin/zmupdate.pl -f >/dev/null } post_remove() { if [[ -d /tmp/zoneminder ]]; then rm -vr /tmp/zoneminder fi #---LinHES Stuff gen_light_include.py /sbin/sv hup /service/lighttpd #-- }