File: telnetd.postrm

package info (click to toggle)
netkit-telnet 0.17-41.2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,412 kB
  • sloc: cpp: 6,451; ansic: 4,263; sh: 110; makefile: 64
file content (56 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
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 -e
# $Id: telnetd.postrm,v 1.10 2002/09/22 04:51:49 herbert Exp $

case "$1" in
abort-install | abort-upgrade | upgrade | failed-upgrade)
	;;
remove | disappear)
	home=~telnetd
	set +e
	userdel telnetd
	err=$?
	set -e
	case $err in
	0)
		if [ "$home" = /usr/lib/telnetd ]; then
			rmdir --ignore-fail-on-non-empty /usr/lib/telnetd || true
		fi
		;;
	6)
		;;
	*)
		exit $err
		;;
	esac

	# Whenever USERGROUPS_ENAB is "yes", see login.defs(5), the group
	# will be gone already after the preceding userdel, so discard
	# the expected error message.
	set +e
	groupdel telnetd 2>/dev/null
	err=$?
	set -e

	case $err in
	0 | 6)
		;;
	*)
		exit $err
		;;
	esac
	;;
purge)
	# If netbase is not installed, then we don't need to do the remove.
	if command -v update-inetd >/dev/null 2>&1; then
		update-inetd --remove "#<off># telnet"
	fi
	;;
*)
	echo "$0: incorrect arguments: $*" >&2
	exit 1
	;;
esac

#DEBHELPER#

exit 0