nut/debian/nut-hal-drivers.preinst
2010-03-26 00:21:03 +01:00

18 lines
589 B
Bash

#!/bin/sh
set -e
if [ "$1" = install ] || [ "$1" = upgrade ]; then
# Remove previous rules if unchanged, otherwise move to new filename.
if [ -e "/etc/udev/rules.d/52_nut-usbups.rules" ]; then
if [ "`md5sum \"/etc/udev/rules.d/52_nut-usbups.rules\" | sed -e \"s/ .*//\"`" = \
"`dpkg-query -W -f='${Conffiles}' nut-hal-drivers | sed -n -e \"\\\\' /etc/udev/rules.d/52_nut-usbups.rules's/.* //p\"`" ]
then
rm -f "/etc/udev/rules.d/52_nut-usbups.rules"
else
mv "/etc/udev/rules.d/52_nut-usbups.rules" "/etc/udev/rules.d/52-nut-usbups.rules"
fi
fi
fi
#DEBHELPER#