File: prerm

package info (click to toggle)
portsentry 1.2-14
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 636 kB
  • ctags: 202
  • sloc: ansic: 3,670; makefile: 463; sh: 184; perl: 94; csh: 31
file content (30 lines) | stat: -rw-r--r-- 888 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
#!/bin/sh
#$Id: prerm,v 1.4 2003/09/08 18:09:03 agx Exp $

set -e

# rm symbolic link to /usr/doc/portsentry when package gets removed or
# upgraded 
# keep this for one stable release to get rid of the symlink
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/portsentry ]; then
	rm -f /usr/doc/portsentry
fi

# to avoid long downtimes upon mass upgrades do not stop the daemon.
# Unfortunately maintainer scripts prior to 1.0-1.2 don't know anything 
# about this. So we have to stop the daemon on downgrades.
if [ -n "$2" ] && dpkg --compare-versions $2 lt 1.0-2 ; then
    if [ -x /usr/sbin/invoke-rc.d ]; then
    	invoke-rc.d portsentry stop
    else
        /etc/init.d/portsentry stop
    fi
elif [ "$1" != "upgrade" ]; then
    if [ -x /usr/sbin/invoke-rc.d ]; then
    	invoke-rc.d portsentry stop
    else
        /etc/init.d/portsentry stop
    fi
fi

#DEBHELPER#