#!/bin/sh set -e #VARS DEFAULT_DISCOVER_METADATA_FILE="/usr/share/plasma/plasmoids/org.kde.discovernotifier/metadata.desktop" DEFAULT_DISCOVER_METADATA_JSON="/usr/share/plasma/plasmoids/org.kde.discovernotifier/metadata.json" DISCOVER_METADATA_FILE_LLIUREX="/usr/share/lliurex-disable-discover-indicator/llx-discovernotifier-metadata.desktop" DISCOVER_METADATA_JSON_LLIUREX="/usr/share/lliurex-disable-discover-indicator/llx-discovernotifier-metadata.json" DEFAULT_DISCOVER_AUTOSTART="/etc/xdg/autostart/org.kde.discover.notifier.desktop" LLX_DISCOVER_AUTOSTART_DIVERSION="/etc/xdg/autostart/org.kde.discover.notifier.desktop.diverted" PACKAGE_NAME="lliurex-disable-discover-indicator" case "$1" in configure) if [ -f $DEFAULT_DISCOVER_METADATA_FILE ];then if dpkg-divert --package ${PACKAGE_NAME} --add --rename --divert ${DEFAULT_DISCOVER_METADATA_FILE}.diverted ${DEFAULT_DISCOVER_METADATA_FILE} ; then ln -fs ${DISCOVER_METADATA_FILE_LLIUREX} ${DEFAULT_DISCOVER_METADATA_FILE} else echo "Unable to divert file \"$DEFAULT_DISCOVER_AUTOSTART\"" >&2 fi fi if [ -f $DEFAULT_DISCOVER_METADATA_JSON ];then if dpkg-divert --package ${PACKAGE_NAME} --add --rename --divert ${DEFAULT_DISCOVER_METADATA_JSON}.diverted ${DEFAULT_DISCOVER_METADATA_JSON} ; then ln -fs ${DISCOVER_METADATA_JSON_LLIUREX} ${DEFAULT_DISCOVER_METADATA_JSON} else echo "Unable to divert file \"$DEFAULT_DISCOVER_AUTOSTART\"" >&2 fi fi if ! [ -f $LLX_DISCOVER_AUTOSTART_DIVERSION ];then dpkg-divert --package ${PACKAGE_NAME} --add --rename --divert ${LLX_DISCOVER_AUTOSTART_DIVERSION} ${DEFAULT_DISCOVER_AUTOSTART} || true fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) exit 1 ;; esac #DEBHELPER#