#!/bin/bash set -e if [ "$1" = "remove" ] ; then PKG="lliurex-artwork-defaults-common" ORIGINAL_WHISKER_ES_FILE="/usr/share/locale/es/LC_MESSAGES/xfce4-whiskermenu-plugin.mo" NEW_DIVERTED_ES_FILE="/usr/share/lliurex-artwork-defaults/diversions/xfce4-whiskermenu-plugin-es.diverted" ORIGINAL_WHISKER_CA_FILE="/usr/share/locale/ca/LC_MESSAGES/xfce4-whiskermenu-plugin.mo" NEW_DIVERTED_CA_FILE="/usr/share/lliurex-artwork-defaults/diversions/xfce4-whiskermenu-plugin-ca.diverted" ORIGINAL_WHISKER_ES_FILE1="/usr/share/locale/es/LC_MESSAGES/mate-xfce4-panel-plugin-loader-applet.mo" NEW_DIVERTED_ES_FILE1="/usr/share/lliurex-artwork-defaults/diversions/mate-xfce4-panel-plugin-loader-applet.mo-es.diverted" ORIGINAL_WHISKER_CA_FILE1="/usr/share/locale/ca/LC_MESSAGES/mate-xfce4-panel-plugin-loader-applet.mo" NEW_DIVERTED_CA_FILE1="/usr/share/lliurex-artwork-defaults/diversions/mate-xfce4-panel-plugin-loader-applet.mo-ca.diverted" ORIGINAL_AUTOSTART_FILE="/etc/xdg/autostart/deja-dup-monitor.desktop" DIVERTED_AUTOSTART_FILE="/usr/share/lliurex-artwork-defaults/diversions/deja-dup-monitor.desktop" ORIGINAL_AUTOSTART_FILE1="/usr/share/mate/autostart/tilda.desktop" DIVERTED_AUTOSTART_FILE1="/usr/share/lliurex-artwork-defaults/diversions/tilda.desktop" ORIGINAL_LO_MOD="/usr/share/ubuntu-mate/settings-overlay/config/libreoffice/4/user/registrymodifications.xcu" DIVERTED_LO_MOD="/usr/share/lliurex-artwork-defaults/diversions/registrymodifications.xcu" LLIUREX_LO_MOD="/usr/share/lliurex-artwork-defaults/libreoffice/registrymodifications.xcu" ORIGINAL_GEOGEBRA="/etc/cron.daily/geogebra" DIVERTED_GEOGEBRA="/usr/share/lliurex-artwork-defaults/diversions/geogebra" if [ -L "$ORIGINAL_WHISKER_ES_FILE" ]; then rm -rf "$ORIGINAL_WHISKER_ES_FILE" || true dpkg-divert --remove --package ${PKG} --rename --divert "$NEW_DIVERTED_ES_FILE" "$ORIGINAL_WHISKER_ES_FILE" fi if [ -L "$ORIGINAL_WHISKER_CA_FILE" ]; then rm -rf "$ORIGINAL_WHISKER_CA_FILE" || true dpkg-divert --remove --package ${PKG} --rename --divert "$NEW_DIVERTED_CA_FILE" "$ORIGINAL_WHISKER_CA_FILE" fi if [ -L "$ORIGINAL_WHISKER_ES_FILE1" ]; then rm -rf "$ORIGINAL_WHISKER_ES_FILE1" || true dpkg-divert --remove --package ${PKG} --rename --divert "$NEW_DIVERTED_ES_FILE1" "$ORIGINAL_WHISKER_ES_FILE1" fi if [ -L "$ORIGINAL_WHISKER_CA_FILE1" ]; then rm -rf "$ORIGINAL_WHISKER_CA_FILE1" || true dpkg-divert --remove --package ${PKG} --rename --divert "$NEW_DIVERTED_CA_FILE1" "$ORIGINAL_WHISKER_CA_FILE1" fi if [ -e "$DIVERTED_AUTOSTART_FILE" ]; then dpkg-divert --remove --package ${PKG} --rename --divert "$DIVERTED_AUTOSTART_FILE" "$ORIGINAL_AUTOSTART_FILE" fi if [ -e "$DIVERTED_AUTOSTART_FILE1" ]; then dpkg-divert --remove --package ${PKG} --rename --divert "$DIVERTED_AUTOSTART_FILE1" "$ORIGINAL_AUTOSTART_FILE1" fi if [ -L "$ORIGINAL_LO_MOD" ]; then rm -rf "$ORIGINAL_LO_MOD" || true dpkg-divert --remove --package ${PKG} --rename --divert "$DIVERTED_LO_MOD" "$ORIGINAL_LO_MOD" fi if [ -e "$DIVERTED_GEOGEBRA" ]; then dpkg-divert --remove --package ${PKG} --rename --divert "$DIVERTED_GEOGEBRA" "$ORIGINAL_GEOGEBRA" fi update-alternatives --auto x-session-manager || true fi #DEBHELPER# exit 0