forked from ghoulmann/rpi-zoneminder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_zoneminder_rpi.sh
57 lines (42 loc) · 1.37 KB
/
install_zoneminder_rpi.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash -ex
# use bash, be verbose
myip=$(hostname -I)
HOSTNAME=zoneminder
# Check for Root
if [[ $(id -u) -ne 0 ]]; then
echo "$0 must be run as root"
exit 1
fi
# Set Hostname to zoneminder
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts
# Install function
install() {
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y \
-o DPkg::Options::=--force-confdef \
-o DPkg::Options::=--force-confold \
install $@
}
# Preseed configuration dpkg UNUSED FOR NOW
#debconf-set-selections << END
#[EXAMPLE] sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
#[EXAMPLE] sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
#[EXAMPLE] sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
#END
# update repos; install from repos
install zoneminder
# floppy link for apache conf for zoneminder
ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf
# Restart apache2
service apache2 restart
# Because Tuxradar says so
chmod 4755 /usr/bin/zmfix
zmfix -a
adduser www-data video
# clean up after apt
find /var/cache/apt -type f -exec rm -f '{}' +
#echo "Zoneminder is now available at http://$myip/zm"
# PostInstall: dpkg-reconfigure nullmailer
#Set mysql root user password: mysqladmin -u root password NEWPASSWORD
#Set zoneminder mysql password: mysqladmin -u admin password NEWPASSWORD