-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall_zoneminder_rpi.sh
70 lines (51 loc) · 1.5 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
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash -ex
#use bash, be verbose
myip=$(hostname -I)
#Check for Root
LUID=$(id -u)
if [[ $LUID -ne 0 ]]; then
echo "$0 must be run as root"
exit 1
fi
#Set Hostname to zoneminder
HOSTNAME=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
#function: clean up after apt
cleanup_apt()
{
rm -r /var/cache/apt/*
mkdir /var/cache/apt/archives
mkdir /var/cache/apt/archives/partial
}
#Clean up after apt
cleanup_apt()
#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