This file is indexed.

postrm is in fex 20130805-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  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
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh
# postrm script for fex
#
# see: dh_installdeb(1)

set -e

. /usr/share/debconf/confmodule

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    purge)
    rm -rf /etc/fex/
    rm -rf /var/lib/fex/
    rm -rf /var/log/fex/
    rm -rf /var/spool/fex/
    dpkg-statoverride --list /etc/fex/fex.ph >/dev/null && dpkg-statoverride --remove /etc/fex/fex.ph
    dpkg-statoverride --list /etc/fex/fup.pl >/dev/null && dpkg-statoverride --remove /etc/fex/fup.pl
    # cleanup user's files (like .bash_history et al.)
    find /usr/share/fex/ -maxdepth 1 -type f  2>/dev/null|xargs --no-run-if-empty rm -f
    if [ -d /etc/xinetd.d ];then
        if [ -x /usr/bin/ucf ];then
            ucf --debconf-ok --purge /etc/xinetd.d/fex
        fi
        rm -f /etc/xinetd.d/fex
        remainingdpkg=`ls -1 /etc/xinetd.d/fex.*-* 2>/dev/null|xargs --no-run-if-empty -n 1 basename||true`
        if [ ! -z "$remainingdpkg" ];then
            echo "DPKG-templates for F*EX service in xinetd not removed:"
            echo "${remainingdpkg}"
            echo "Please remove yourself if no longer required."
        fi
        remainingsrv=`grep -r /usr/share/fex/bin/fexsrv /etc/xinetd.d|grep -v '^/etc/xinetd.d/fex:'|sed -e 's#^/etc/xinetd.d/\([^:]\+\):.*#\1#'|grep -v 'fex.*-*'||true`
        if [ ! -z "$remainingsrv" ];then
            echo "User-defined services in xinetd not removed:"
            echo "${remainingsrv}"
            echo "Please remove yourself!"
        fi
        if [ -x /etc/init.d/xinetd ]; then
            if [ -x /usr/sbin/invoke-rc.d ]; then
                invoke-rc.d xinetd reload || true
            else
                /etc/init.d/xinetd reload
            fi
	else
            # xinetd is already purged
	    [ -d /etc/xinetd.d/ ]&&rmdir --ignore-fail-on-non-empty /etc/xinetd.d/
	    [ -d /etc/xinetd.d/ ]&&echo 1>&2 "Cannot remove /etc/xinetd.d/ even though xinetd is no longer installed due to customized services"
        fi
    elif [ -r /etc/inetd.conf ];then
        # We're running openbsd-inetd or something similar
        fextcpport=`grep /usr/share/fex/bin/fexsrv /etc/inetd.conf 2>/dev/null|awk '{print $1}'||true`
        if [ ! -z "$fextcpport" -a -x /usr/sbin/update-inetd ];then
            # as --multi is ugly we'll only support v4 through inetd.conf
            # whoever wants IPv6 needs to go xinetd or hack his own version
            # i.e. replace tcp with tcp6
            echo "$fextcpport"|while read fexport;do
            update-inetd --remove $fexport
            done
        else
            echo 'Unable to automatically update inetd.conf'
            echo 'Please update yourself and restart inetd'
        fi
    fi
    # make sure to run this once fexsrv is shut down or we get a "user is logged in error"
    if [ -x "$(command -v deluser)" ]; then
	echo "Removing fex user account"
        deluser --quiet --system fex > /dev/null || true
    elif [ -x "$(command -v userdel)" ];then
	echo "Removing fex user account"
        userdel fex||true
    else
        echo >&2 "not removing fex system account because deluser command was not found"
    fi
    # Remove my changes to the db.
    db_purge
    ;;
    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

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

# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section


exit 0

# vi: set smartindent ts=4 sw=4 expandtab autoindent: