preinst is in nut-server 2.6.3-1ubuntu1.1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/bin/sh -e
if [ "$1" = upgrade ]; then
# remove the obsolete udev file
[ -f /etc/udev/rules.d/025_nut-usbups.rules ] && rm -f /etc/udev/rules.d/025_nut-usbups.rules
# 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 | 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
# migrate /etc/default/nut to /etc/nut/nut.conf (part #1)
# we need to do this before default gets trashed
if [ -f /etc/default/nut ] ; then
# backup /etc/default/nut
cp /etc/default/nut /etc/default/nut.bak
fi
fi
|