#!/bin/bash set -e #VARS SYSTEM_CONFIG_SCRIPT="/usr/bin/update-manager" SYSTEM_AUTOSTART_SCRIPT="/usr/bin/update-notifier" OUR_AUTOSTART_BINARY="/bin/true" OUR_BINARY=/usr/sbin/lliurex-up OUR_PACKAGE="lliurex-up" case $1 in configure) :<<-! if dpkg-divert --package lliurex-up --rename --quiet --add --divert ${SYSTEM_CONFIG_SCRIPT}.real ${SYSTEM_CONFIG_SCRIPT} ; then ln -fs ${OUR_BINARY} ${SYSTEM_CONFIG_SCRIPT} else echo "Unable to divert file \"$SYSTEM_CONFIG_SCRIPT\"" >&2 fi if dpkg-divert --package lliurex-up --rename --quiet --add --divert ${SYSTEM_AUTOSTART_SCRIPT}.real ${SYSTEM_AUTOSTART_SCRIPT} ; then ln -fs ${OUR_AUTOSTART_BINARY} ${SYSTEM_AUTOSTART_SCRIPT} else echo "Unable to divert file \"$SYSTEM_AUTOSTART_SCRIPT\"" >&2 fi ! if dpkg --compare-versions "$2" lt 16.04.11; then F="/usr/share/lliurex-up/includes/etc/apt/preferences.d/lliurex-pinning" if [ -e "$F" ]; then rm -rf $F fi fi ;; esac #DEBHELPER# exit 0