File: fetchmail.postrm

package info (click to toggle)
fetchmail 6.2.5-12sarge5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,048 kB
  • ctags: 2,362
  • sloc: ansic: 19,329; sh: 3,735; python: 1,797; perl: 564; makefile: 501; yacc: 461; lex: 262; awk: 124; sed: 93; lisp: 84
file content (45 lines) | stat: -rw-r--r-- 1,053 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
#!/bin/sh
#
# Postrm script for fetchmail
# $Id: fetchmail.postrm 106 2004-02-22 03:59:07Z bob $
#

set -e

#DEBHELPER#

if [ "$1" = "purge" ]; then
	if [ -e /usr/share/debconf/confmodule ]; then
		. /usr/share/debconf/confmodule
		db_purge
	fi

	# Remove SysV initscript
	update-rc.d fetchmail remove >/dev/null || true

	# Also remind user of /etc/fetchmailrc
	if [ -r /etc/fetchmailrc ]; then
		echo "Not removing /etc/fetchmailrc ..." >&2
		chown root /etc/fetchmailrc
	fi

	# Remove init.d configuration file
	if [ -r /etc/default/fetchmail ]; then
		rm -f /etc/default/fetchmail
	fi

	# Remove other cruft
	rm -f /var/mail/.fetchmail-UIDL-cache >/dev/null 2>&1 || true

	# Remove user fetchmail
	fetchmailhome=`getent passwd fetchmail | cut -d : -f 6`
	rm -f "$fetchmailhome/.fetchids" >/dev/null 2>&1 || true
	rm -f "$fetchmailhome/.fetchmail-UIDL-cache" >/dev/null 2>&1 || true
	rm -f "$fetchmailhome/.fetchmail.pid" >/dev/null 2>&1 || true
	userdel fetchmail || true
	rmdir "$fetchmailhome" >/dev/null 2>&1 || true
fi

exit 0

# vim:ts=4:sw=4: