summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/zoneminder/zoneminder.install
blob: 1f3cfc0603ec6e967dc4b577f26baefbc5ebd0cd (plain)
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
# zoneminder.install

## arg 1:  the new package version
pre_install() {
   echo
}

## arg 1:  the new package version
post_install() {
chown http.http /data/srv/httpd/htdocs/zm/events
chown http.http /data/srv/httpd/htdocs/zm/images
chown http.http /data/srv/httpd/htdocs/zm/temp
chown http.http /etc/zm.conf

cat << EOF
Note:
==> mythtv has been defined in /etc/zm.conf as user and password for
==> The zoneminder (zm) database
==> To initialize the ZoneMinder database run (as root)
==> /usr/lib/zm/bin/zminit

EOF

cat /etc/sysctl.conf |grep "kernel.shmall" >/dev/null || cat << EOF
==> To raise the limit on shared memory for zoneminder
==> add these lines to /etc/sysctl.conf
==> kernel.shmall = 134217728
==> kernel.shmmax = 134217728
EOF


[ -d /var/lib/zm ] || mkdir /var/lib/zm/
touch /var/lib/zm/zm_backup.sql

# Reuse the old config
[ -f /etc/zm.conf.pacnew ] && cat /etc/zm.conf | sed -e "s/^ZM_VERSION=.*$/ZM_VERSION=1.23.3/" > /tmp/zm.conf
[ -f /etc/zm.conf.pacsave ] &&  cat /etc/zm.conf.pacsave | sed -e "s/^ZM_VERSION=.*$/ZM_VERSION=1.23.3/" > /tmp/zm.conf
[ -f /tmp/zm.conf ] && mv -f /tmp/zm.conf /etc/zm.conf && chown -R nobody.nobody /etc/zm.conf

}

## arg 1:  the new package version
## arg 2:  the old package version
pre_upgrade() {
  echo
}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {

  # Reuse the old config
[ -f /etc/zm.conf.pacnew ] && cat /etc/zm.conf | sed -e "s/^ZM_VERSION=.*$/ZM_VERSION=1.23.3/" > /tmp/zm.conf
[ -f /etc/zm.conf.pacsave ] &&  cat /etc/zm.conf.pacsave | sed -e "s/^ZM_VERSION=.*$/ZM_VERSION=1.23.3/" > /tmp/zm.conf
[ -f /tmp/zm.conf ] && mv -f /tmp/zm.conf /etc/zm.conf && chown -R http.http /etc/zm.conf
add_service.sh zm
}
## arg 1:  the old package version
pre_remove() {
  echo
}

## arg 1:  the old package version
post_remove() {
  echo
  remove_service.sh zm
}

# vim:set ts=2 sw=2 et: