summaryrefslogtreecommitdiff
path: root/debian/lighttpd.postrm
blob: 2c2d676de7902def5f2674460ee6a2169ca33812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh -e
# postrm script for lighttpd

set -e

if [ "$1" = "purge" ]; then
    rm -rf /var/log/lighttpd /var/run/lighttpd /var/cache/lighttpd


    if [ -d /etc/lighttpd/conf-enabled/ ] ; then
        # The loop below fixes #642494 (mostly)
        for link in /etc/lighttpd/conf-enabled/*.conf ; do
            target=$(readlink "$link") || true
	    if [ -n "$target" ] && [ ! -e "/etc/lighttpd/conf-enabled/$target" ] ; then
                echo "removing dangling symlink $link ..."
                rm -f $link
            fi
        done
    fi
fi

#DEBHELPER#

exit 0