2014-01-27 22:39:59 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Start MySQL
|
|
|
|
/usr/bin/mysqld_safe &
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
# Create the ZoneMinder database
|
|
|
|
mysql -u root < db/zm_create.sql
|
|
|
|
|
|
|
|
# Add the ZoneMinder DB user
|
2014-01-27 23:20:20 +08:00
|
|
|
mysql -u root -e "grant insert,select,update,delete,lock tables,alter on zm.* to 'zm'@'localhost' identified by 'zm'"
|
2014-01-27 22:39:59 +08:00
|
|
|
|
|
|
|
# Install the ZoneMinder apache vhost file
|
|
|
|
wget --quiet https://raw.github.com/kylejohnson/puppet-zoneminder/master/files/zoneminder -O /etc/apache2/sites-enabled/000-default
|
|
|
|
|
|
|
|
# Restart apache
|
|
|
|
service apache2 restart
|
|
|
|
|
|
|
|
# Start ZoneMinder
|
|
|
|
/usr/local/bin/zmpkg.pl start
|