Only remove /etc/init.d/nut from previous versions of nut in nut-server postinst if there are no local changes.

* Only remove /etc/init.d/nut from previous versions of nut in nut-server
  postinst if there are no local changes.
* Also remove /etc/init.d/nut in nut-client postinst. Thanks to
  Laurent Bigonville for the hint.
This commit is contained in:
Laurent Bigonville 2013-01-13 17:36:52 +01:00
parent d54dd54840
commit 715368e54f
3 changed files with 22 additions and 3 deletions

View file

@ -54,8 +54,13 @@ case "$1" in
# 557178 udevadm trigger --subsystem-match=usb
if dpkg --compare-versions "$2" le "2.6.4-2~" ; then
rm -f /etc/init.d/nut
if dpkg --compare-versions "$2" le "2.6.4-2~" &&
[ -f /etc/init.d/nut ] ; then
if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then
rm -f /etc/init.d/nut
else
mv /etc/init.d/nut /etc/init.d/nut.dpkg-old
fi
update-rc.d nut remove >/dev/null
fi
;;