File: nut-client.preinst

package info (click to toggle)
nut 2.7.4-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,964 kB
  • sloc: ansic: 70,278; sh: 12,814; python: 2,202; cpp: 1,715; makefile: 1,406; perl: 705; xml: 40
file content (23 lines) | stat: -rw-r--r-- 824 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

# Revert /etc/nut/nut.conf mangling done by older versions of the postinst
# See #677054
# changed configfile created by a fresh install in lenny, upgraded to squeeze
if [ "$1" = "install" -o "$1" = "upgrade" ] \
    && dpkg --compare-versions "$2" lt "2.6.4-2" \
    && [ -f /etc/nut/nut.conf ] \
    && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = 331cca39153f451c2968f4b734c1cf3f ]; then
       sed -i '29,$ d' /etc/nut/nut.conf
fi

# changed configfile created by a fresh install in squeeze
if [ "$1" = "install" -o "$1" = "upgrade" ] \
    && dpkg --compare-versions "$2" lt "2.6.4-2" \
    && [ -f /etc/nut/nut.conf ] \
    && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then
    sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf
fi

#DEBHELPER#