#! /bin/sh set -e TARGET="/etc/zm/core.php" SOURCE="/usr/share/zoneminder/www/api/app/Config/core.php.default" Generate_random () { tr -dc $1 < /dev/urandom | head -c $2 } if [ "$1" = "configure" ]; then chown www-data:root /var/log/zm chown www-data:www-data /var/lib/zm if [ -z "$2" ]; then chown www-data:www-data -R /var/cache/zoneminder fi if [ ! -e "${TARGET}" ]; then printf "I: Generating ${TARGET} from ${SOURCE} ...\n" >&2 sed \ -e "s@__ZM_API_SALT__@$(Generate_random A-Za-z0-9 29)@g" \ -e "s@__ZM_API_SEED__@$(Generate_random 0-9 40)@g" \ ${SOURCE} > ${TARGET} fi fi # Automatically added by dh_installsystemd/13.7.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # In case this system is running systemd, we need to ensure that all # necessary tmpfiles (if any) are created before starting. if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ] ; then systemd-tmpfiles --create zoneminder.conf >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installdeb/13.7.1 dpkg-maintscript-helper rm_conffile /etc/zm/apache.conf 1.28.1-5\~ -- "$@" dpkg-maintscript-helper dir_to_symlink /usr/share/zoneminder/www/api/lib/Cake /usr/share/php/Cake 1.30.4\+dfsg1-4\~ -- "$@" dpkg-maintscript-helper symlink_to_dir /usr/share/zoneminder/www/api/lib/Cake /usr/share/php/Cake 1.36.5\+dfsg1-1\~ -- "$@" # End automatically added section # Automatically added by dh_installinit/13.7.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "/etc/init.d/zoneminder" ]; then update-rc.d zoneminder defaults >/dev/null || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.7.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed 'zoneminder.service'; then # This will only remove masks created by d-s-h on package removal. deb-systemd-helper unmask 'zoneminder.service' >/dev/null || true if deb-systemd-helper --quiet was-enabled 'zoneminder.service'; then # Create new symlinks, if any. deb-systemd-helper enable 'zoneminder.service' >/dev/null || true fi fi # Update the statefile to add new symlinks (if any), which need to be cleaned # up on purge. Also remove old symlinks. deb-systemd-helper update-state 'zoneminder.service' >/dev/null || true fi # End automatically added section