2015-08-18 02:03:27 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
## Remove obsolete symlink which is in the way of dh_apache2:
|
|
|
|
ol="/etc/apache2/conf-available/zoneminder.conf"
|
|
|
|
if [ -h "${ol}" ]; then
|
|
|
|
[ "$(readlink ${ol})" = "/etc/zm/apache.conf" ] && rm -f "${ol}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
abort=false
|
|
|
|
if [ -h /usr/share/zoneminder/www/events ]; then
|
|
|
|
l=$(readlink /usr/share/zoneminder/www/events)
|
2015-09-15 02:55:37 +08:00
|
|
|
if [ "$l" != "/var/cache/zoneminder/events" -a "$l" != "/var/cache/zoneminder/events/" ]; then
|
2015-08-18 02:03:27 +08:00
|
|
|
abort=true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -h /usr/share/zoneminder/www/images ]; then
|
|
|
|
l=$(readlink /usr/share/zoneminder/www/images )
|
2015-09-15 02:55:37 +08:00
|
|
|
if [ "$l" != "/var/cache/zoneminder/images" -a "$l" != "/var/cache/zoneminder/images/" ]; then
|
2015-08-18 02:03:27 +08:00
|
|
|
abort=true
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$abort" = "true" ]; then
|
|
|
|
cat >&2 << EOF
|
|
|
|
Aborting installation of zoneminder due to non-default symlinks in
|
|
|
|
/usr/share/zoneminder for the images and/or events directory, which could
|
|
|
|
result in loss of data. Please move your data in each of these directories to
|
|
|
|
/var/cache/zoneminder before installing zoneminder from the package.
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
#DEBHELPER#
|