File: fetchmail-ssl.postinst

package info (click to toggle)
fetchmail-ssl 5.9.11-6.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,952 kB
  • ctags: 2,498
  • sloc: ansic: 20,487; sh: 3,574; python: 1,705; yacc: 761; makefile: 682; perl: 640; lex: 258; awk: 124; sed: 93; lisp: 84
file content (63 lines) | stat: -rw-r--r-- 1,888 bytes parent folder | download
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
57
58
59
60
61
62
63
#!/bin/sh
#
# Postinst script for fetchmail/fetchmail-ssl
# $Id: fetchmail.postinst,v 1.18 2002/02/16 03:15:04 hmh Exp $
#

set -e
package=fetchmail-ssl

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
# quoting from the policy:
#     Any necessary prompting should almost always be confined to the
#     post-installation script, and should be protected with a conditional
#     so that unnecessary prompting doesn't happen if a package's
#     installation fails and the `postinst' is called with `abort-upgrade',
#     `abort-remove' or `abort-deconfigure'.

case "$1" in
    configure)

	# Handle move of debconf templates to fetchmail-common
	. /usr/share/debconf/confmodule
	db_purge
	db_stop

	# Handle second half of /usr/share/doc upgrade
	[ -d "/usr/share/doc/${package}.toberemoved" ] && 
		rm -rf "/usr/share/doc/${package}.toberemoved"

	# Handle .fetchids move request in a safe way
	# - starts daemon -
	ROOTHOME=`getent passwd root | cut -d : -f 6`
	find ${ROOTHOME} -user root -maxdepth 0 >/dev/null 2>&1 || \
	  ROOTHOME=/root

	[ -r ${ROOTHOME}/.fetchids -a ! -r /var/mail/.fetchmail-UIDL-cache ] ||\
	  [ -x /etc/init.d/fetchmail -a -x /usr/bin/fetchmail ] && \
	    /etc/init.d/fetchmail start || true
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0