File: postinst

package info (click to toggle)
sarg 2.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,456 kB
  • sloc: ansic: 17,692; sh: 4,581; xml: 371; javascript: 352; php: 205; makefile: 183; sed: 16; pascal: 2
file content (56 lines) | stat: -rw-r--r-- 1,358 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /bin/sh

set -e

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

    [ -e "$OLDCONFFILE" ] || return 0

    echo "Preserving user changes to $NEWCONFFILE ..."
    mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
    mv -f "$OLDCONFFILE" "$NEWCONFFILE"
}

case "$1" in
	install|configure)
		if dpkg --compare-versions "$2" lt 2.2.6-1; then
			mv_conffile "/etc/squid/sarg.conf" "/etc/sarg/sarg.conf"
			mv_conffile "/etc/squid/sarg.exclude_codes" "/etc/sarg/exclude_codes"
			mv_conffile "/etc/squid/sarg.hosts" "/etc/sarg/exclude_hosts"
			mv_conffile "/etc/squid/sarg-reports.conf" "/etc/sarg/sarg-reports.conf"
			mv_conffile "/etc/squid/sarg.users" "/etc/sarg/exclude_users"
			mv_conffile "/etc/squid/sarg.usertab" "/etc/sarg/usertab"
			mv_conffile "/etc/squid/user_limit_block" "/etc/sarg/user_limit_block"
		fi

		if [ -e /etc/squid/fonts/Verdana.TTF ] ; then
			rm /etc/squid/fonts/Verdana.TTF
		fi

		if [ -e /etc/squid/fonts/license ] ; then
			rm /etc/squid/fonts/license
		fi

		if [ -e /etc/squid/fonts/README ] ; then
			rm /etc/squid/fonts/README
		fi

		if [ -e /etc/squid/sarg-maint.sh ] ; then
			rm /etc/squid/sarg-maint.sh
		fi

		;;
	abort-upgrade|abort-remove|abort-deconfigure)
		;;
	*)
		#
		#	Unknown action - do nothing.
		#
		exit 0
		;;
esac

#DEBHELPER#