summaryrefslogtreecommitdiffstats
path: root/abs/core
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2014-12-20 17:51:33 (GMT)
committerBritney Fransen <brfransen@gmail.com>2014-12-20 17:51:33 (GMT)
commit317075f448a7f47d66976273d4c9ae23b1c663dc (patch)
tree5ee82ee1edba7d359b85cbb9e0ba453f5a73a0ad /abs/core
parentcc90fc2cb2d57a6bf9b040001f8950fff50c967a (diff)
downloadlinhes_pkgbuild-317075f448a7f47d66976273d4c9ae23b1c663dc.zip
linhes_pkgbuild-317075f448a7f47d66976273d4c9ae23b1c663dc.tar.gz
linhes_pkgbuild-317075f448a7f47d66976273d4c9ae23b1c663dc.tar.bz2
zoneminder: forgot to mod .install
Diffstat (limited to 'abs/core')
-rw-r--r--abs/core/zoneminder/PKGBUILD2
-rw-r--r--abs/core/zoneminder/zoneminder.install32
2 files changed, 33 insertions, 1 deletions
diff --git a/abs/core/zoneminder/PKGBUILD b/abs/core/zoneminder/PKGBUILD
index 75b3301..a6402e8 100644
--- a/abs/core/zoneminder/PKGBUILD
+++ b/abs/core/zoneminder/PKGBUILD
@@ -11,7 +11,7 @@
pkgbase=zoneminder
pkgname=zoneminder
pkgver=1.28.0
-pkgrel=1
+pkgrel=2
pkgdesc='Capture, analyse, record and monitor video security cameras'
arch=( i686 x86_64 mips64el arm )
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):