diff options
Diffstat (limited to 'abs/core/zoneminder/zoneminder.install')
-rw-r--r-- | abs/core/zoneminder/zoneminder.install | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/abs/core/zoneminder/zoneminder.install b/abs/core/zoneminder/zoneminder.install index 0a1f557..1d450aa 100644 --- a/abs/core/zoneminder/zoneminder.install +++ b/abs/core/zoneminder/zoneminder.install @@ -1,3 +1,20 @@ +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 + } + pre_install() { set -e abort=false @@ -78,6 +95,13 @@ post_install() { \|^Include /etc/httpd/conf/extra/httpd-zoneminder.conf$|d; s|^# Server-pool management (MPM specific)$|\nInclude /etc/httpd/conf/extra/httpd-zoneminder.conf\n&|; ' /etc/httpd/conf/httpd.conf > /etc/httpd/conf/httpd.conf.zoneminder + + #---LinHES Stuff + usermod -G video http + install_db + gen_light_include.py + /sbin/sv hup /service/lighttpd + #--- cat << EOF Note for mysql: @@ -123,6 +147,10 @@ EOF post_upgrade() { post_install /usr/bin/zmupdate.pl -f >/dev/null + #---LinHES Stuff + gen_light_include.py + /sbin/sv hup /service/lighttpd + #-- } post_remove() { @@ -138,6 +166,10 @@ post_remove() { # /Include \/etc\/httpd\/conf\/extra\/httpd-zoneminder.conf/d; # ' /etc/httpd/conf/httpd.conf || read + #---LinHES Stuff + gen_light_include.py + /sbin/sv hup /service/lighttpd + #-- cat << EOF Note: ==> To clean Zoneminder mysql database, run as root (with password): |