File: snoopy.prerm

package info (click to toggle)
snoopy 2.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,016 kB
  • sloc: ansic: 7,169; sh: 4,514; makefile: 1,095
file content (29 lines) | stat: -rwxr-xr-x 628 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

set -e

PRELOAD="/etc/ld.so.preload"
LIBNAME="libsnoopy.so"

[ -n "$SNOOPYDEBUG" ] && set -x

case "$1" in
    remove|upgrade|deconfigure)
        # remove $LIBNAME from $PRELOAD (if present)
        if grep -vqs "/${LIBNAME}$" $PRELOAD ; then
            # the file remains non-empty if $LIBNAME is removed
            TEMPFILE=`mktemp`
            grep -v "/${LIBNAME}$" $PRELOAD > "$TEMPFILE"
            mv -f "$TEMPFILE" $PRELOAD
        else
            rm -f $PRELOAD
        fi
        ;;
    failed-upgrade)
        ;;
    *)
        echo >&2 "prerm called with unknown argument $1"
    ;;
esac

#DEBHELPER#