#!/bin/bash # Automatically added by dh_installinit/13.3.4 if [ "$1" = "purge" ] ; then update-rc.d wb-systime-adjust remove >/dev/null fi # End automatically added section # Automatically added by dh_installinit/13.3.4 if [ "$1" = "purge" ] ; then update-rc.d wb-configs remove >/dev/null fi # End automatically added section # Automatically added by dh_installinit/13.3.4 if [ "$1" = "purge" ] ; then update-rc.d wb-configs-early remove >/dev/null fi # End automatically added section # Automatically added by dh_installdeb/13.3.4 dpkg-maintscript-helper rm_conffile /etc/kernel/postinst.d/zImage-uboot -- "$@" dpkg-maintscript-helper rm_conffile /etc/init.d/wb-configs 1.76\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apt/sources.list.d/contactless.list 1.76\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apt/sources.list.d/wheezy-backports.list 1.76\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apt/sources.list.d/nodesource.list 3.30.1\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/apt/preferences 1.78\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/preferences 1.78\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/mosquitto/conf.d/auth.conf 3.0.0\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/mosquitto/conf.d/listeners.conf 3.0.0\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/mosquitto/conf.d/bridge.conf 3.0.0\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/mosquitto/conf.d/bridge.conf.example 3.0.0\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/mosquitto/conf.d/30limits.conf 3.22.0\~ -- "$@" dpkg-maintscript-helper rm_conffile /etc/ssl/openssl.cnf 3.22.1\~ -- "$@" # End automatically added section # Automatically added by dh_systemd_start/13.3.4 if [ -d /run/systemd/system ] && [ "$1" = remove ]; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_systemd_start/13.3.4 if [ -d /run/systemd/system ] && [ "$1" = remove ]; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_systemd_start/13.3.4 if [ -d /run/systemd/system ] && [ "$1" = remove ]; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_systemd_enable/13.3.4 if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper mask 'wb-systime-adjust.service' >/dev/null || true fi fi if [ "$1" = "purge" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge 'wb-systime-adjust.service' >/dev/null || true deb-systemd-helper unmask 'wb-systime-adjust.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_systemd_enable/13.3.4 if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper mask 'wb-configs.service' >/dev/null || true fi fi if [ "$1" = "purge" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge 'wb-configs.service' >/dev/null || true deb-systemd-helper unmask 'wb-configs.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_systemd_enable/13.3.4 if [ "$1" = "remove" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper mask 'wb-configs-early.service' >/dev/null || true fi fi if [ "$1" = "purge" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge 'wb-configs-early.service' >/dev/null || true deb-systemd-helper unmask 'wb-configs-early.service' >/dev/null || true fi fi # End automatically added section RULES_DST_DIR=/etc/udev/rules.d purge_ucf_conffile() { if [ -x /usr/bin/ucf ]; then ucf --purge $1 rm -f $1 fi } if [ "$1" = "purge" ]; then purge_ucf_conffile "$RULES_DST_DIR/99-wb-uart.rules" purge_ucf_conffile "$RULES_DST_DIR/99-wb-ethernet.rules" fi udevadm trigger # apply new udev rules # restore original mosquitto scripts # the same section is in preinst script mosquitto_apps=("mosquitto_sub" "mosquitto_pub" "mosquitto_rr") for file in "${mosquitto_apps[@]}"; do # During remove/purge, postrm script runs after old files are deleted. # When upgrading, it runs _before_ it. # It's not a problem if upgrade keeps divertion of mosquitto tools, # but breaks them on downgrade. if [[ "$1" = "upgrade" ]] && dpkg --compare-versions "$2" lt "3.5.0~~"; then echo "WARNING: downgrading from mosquitto-wrapping version, remove wrappers" rm -f "/usr/bin/${file}" fi if [[ ! -e "/usr/bin/${file}" ]]; then dpkg-divert --package wb-configs --rename --remove "/usr/bin/${file}" fi done # restore original mosquitto conf.d directory to support switching between testing and stable (wb-2307) # (it would be better to fix wb_move function in wb-configs-early, but it requires changes in stable release) # can be removed with next stable release if [ -L /etc/mosquitto/conf.d ] && [ "$(readlink /etc/mosquitto/conf.d)" = "/mnt/data/etc/mosquitto/conf.d" ]; then rm /etc/mosquitto/conf.d rsync -av --exclude=00default_listener.conf --exclude=10listeners.conf --exclude=20bridges.conf /mnt/data/etc/mosquitto/conf.d /etc/mosquitto if [ -f /mnt/data/etc/mosquitto/conf.d/00default_listener.conf ]; then ln -Tfs /mnt/data/etc/mosquitto/conf.d/00default_listener.conf /etc/mosquitto/conf.d/00default_listener.conf fi if [ -f /mnt/data/etc/mosquitto/conf.d/10listeners.conf ]; then ln -Tfs /mnt/data/etc/mosquitto/conf.d/10listeners.conf /etc/mosquitto/conf.d/10listeners.conf fi if [ -f /mnt/data/etc/mosquitto/conf.d/20bridges.conf ]; then ln -Tfs /mnt/data/etc/mosquitto/conf.d/20bridges.conf /etc/mosquitto/conf.d/20bridges.conf fi fi