File: monkeysphere.postrm

package info (click to toggle)
monkeysphere 0.44-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 684 kB
  • sloc: sh: 1,451; perl: 759; ansic: 719; makefile: 91
file content (40 lines) | stat: -rwxr-xr-x 1,291 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

# postrm script for monkeysphere

# Author: Jameson Rollins <jrollins@finestructure.net>, 
#         Daniel Kahn Gillmor <dkg@fifthhorseman.net>
# Copyright 2008-2019

set -e

case $1 in
    purge)
        # protect users from locking themselves out:
        if which sshd >/dev/null && sshd -T | grep -i '^authorizedkeysfile.*/var/lib/monkeysphere' >&2 ; then
            echo >&2 ""
            echo >&2 "  Monkeysphere Warning!"
            echo >&2 "  ====================="
            echo >&2 "  Not purging monkeysphere because sshd is configured to rely on it."
            echo >&2 "  Please remove AuthorizedKeysFile references to /var/lib/monkeysphere"
            echo >&2 "  from sshd_config before purging the monkeysphere package."
            echo >&2 ""
            exit 1
        fi
	# delete monkeysphere user
	# https://wiki.debian.org/AccountHandlingInMaintainerScripts
	if which deluser >/dev/null 2>&1 ; then
	    deluser --quiet --system monkeysphere > /dev/null || true
	else
	    echo >&2 "not removing monkeysphere system account because deluser command was not found"
	fi
        rm -rf /var/lib/monkeysphere
        ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0