File: postrm

package info (click to toggle)
sendfile 2.1b.20080616-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,548 kB
  • ctags: 745
  • sloc: ansic: 13,128; sh: 3,885; perl: 851; makefile: 143; java: 36; csh: 3
file content (35 lines) | stat: -rw-r--r-- 686 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
#! /bin/sh
# post removal script for the Debian GNU/Linux sendfile package

set -e

if [ "$1" = "remove" ]
then
    for profile in /etc/profile /etc/csh.login
    do
	grep -v 'check-sendfile' $profile > $profile.new || /bin/true
	mv -f $profile.new $profile
    done
fi

if [ "$1" = "purge" ]
then
  rm -rf /var/log/sendfile >/dev/null

    if [ -d /var/spool/sendfile ]
    then
	cd /var/spool/sendfile

	if [ -n "`ls`" ]; then
	    for u in *; do
		for num in 7 6 5 4 3 2 1; do
		    if [ -f $u/log.$num ]; then rm -f $u/log.$num; fi
		done
	    done
	fi
	cd /
	rm -rf /var/spool/sendfile >/dev/null
    fi
fi

test ! -x /usr/sbin/update-inetd || /usr/sbin/update-inetd --remove saft