18 lines
589 B
Bash
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#
|