#!/bin/sh set -e # Template for diversions ORIG_UDISKS_FILE="/usr/share/polkit-1/actions/org.freedesktop.udisks.policy" OUR_UDISKS_FILE="/usr/share/lliurex-policy/polkit-1/actions/org.freedesktop.udisks.policy" ORIG_UDISKS2_FILE="/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy" OUR_UDISKS2_FILE="/usr/share/lliurex-policy/polkit-1/actions/org.freedesktop.udisks2.policy" ORIG_CONSOLEKIT_FILE="/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy" OUR_CONSOLEKIT_FILE="/usr/share/lliurex-policy/polkit-1/actions/org.freedesktop.consolekit.policy " OUR_PACKAGE="lliurex-policy" case $1 in configure) echo " * [ LliureX Policy ] : Diverting Udisks file" if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_UDISKS_FILE}.real ${ORIG_UDISKS_FILE} ; then ln -fs ${OUR_UDISKS_FILE} ${ORIG_UDISKS_FILE} else echo "Unabe to divert file ${ORIG_UDISKS_FILE}" fi echo " * [ LliureX Policy ] : Diverting Udisks2 file : Testing if exists" if [ -f ${ORIG_UDISKS2_FILE} ]; then echo " * [ LliureX Policy ] : Diverting Udisks2 file : Exists...divert!" if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_UDISKS2_FILE}.real ${ORIG_UDISKS2_FILE} ; then ln -fs ${OUR_UDISKS2_FILE} ${ORIG_UDISKS2_FILE} else echo "Unabe to divert file ${ORIG_UDISKS2_FILE}" fi else echo " * [ LliureX Policy ] : Diverting Udisks2 file : Not exists...nothing to do" fi echo " * [ LliureX Policy ] : Diverting Policy file" if dpkg-divert --package ${OUR_PACKAGE} --add --rename --divert ${ORIG_CONSOLEKIT_FILE}.real ${ORIG_CONSOLEKIT_FILE} ; then ln -fs ${OUR_CONSOLEKIT_FILE} ${ORIG_CONSOLEKIT_FILE} else echo "Unabe to divert file ${ORIG_CONSOLEKIT_FILE}" fi ;; *) echo "Nothing to do" ;; esac # Other Stuff # #DEBHELPER#