File: srg.postinst

package info (click to toggle)
srg 1.3.5-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,956 kB
  • ctags: 776
  • sloc: sh: 9,073; cpp: 3,383; ansic: 563; makefile: 74; php: 57; yacc: 35; lex: 30
file content (31 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /bin/sh
# postinst script for SRG
#
# Author:   Matt Brown <debian@mattb.net.nz>
# Version:  $Id:$
# Released under the GPL v2

set -e

# conffile handling thanks to http://www.dpkg.org/ConffileHandling

# Move a conffile without triggering a dpkg question
mv_conffile() {
    OLDCONFFILE="$1"
    NEWCONFFILE="$2"

    if [ -e "$OLDCONFFILE" ]; then
        echo "Preserving user changes to $NEWCONFFILE ..."
        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
    fi
}

case "$1" in
configure)
    if dpkg --compare-versions "$2" le "1.3.3-2"; then
        mv_conffile "/etc/srg/ip2user.txt" "/etc/srg/ip2user"
    fi
esac

#DEBHELPER#