Skip to content

Instantly share code, notes, and snippets.

@bspavel
Last active January 14, 2018 21:14
Show Gist options
  • Save bspavel/74daff5caf08095b6c0f38c18cfa15cd to your computer and use it in GitHub Desktop.
Save bspavel/74daff5caf08095b6c0f38c18cfa15cd to your computer and use it in GitHub Desktop.
#!/bin/bash
#Thanks to https://wiki.zoneminder.com/Raspbian
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!!)"
exit
fi
# Disable Wi-Fi and Bluetooth
read -p "Do you want to disable modules Wi-Fi and Bluetooth? <y/N> " prompt
if [ "$prompt" = "y" ]; then
cat >> /boot/config.txt << "EOF"
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
EOF
fi
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get install -y rpi-update
aptitude hold tar
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get install libvlc-dev libvlccore-dev vlc -y
apt-get install php mysql-server php-pear php-mysql php-gd-y
apt-get install zoneminder -y
mysql < /usr/share/zoneminder/db/zm_create.sql
mysql -e "grant select,insert,update,delete,create on zm.* to 'zmuser'@localhost identified by 'zmpass';"
chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf
systemctl enable zoneminder.service
adduser www-data video
systemctl start zoneminder.service
systemctl status zoneminder.service
a2enmod cgi
a2enconf zoneminder
service apache2 restart
cd /usr/src && wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz
tar -xzvf cambozola-latest.tar.gz
replace 936 with cambozola version downloaded
cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder
echo "kernel.shmmax = 134217728" >> /etc/sysctl.conf
sed -i 's/^;date.timezone =/date.timezone=Europe\/Kiev/' /etc/php/7.0/apache2/php.ini
service apache2 restart
echo "don't forget execute:" && echo "sudo raspi-config"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment