File: lighttpd.postrm

package info (click to toggle)
lighttpd 1.4.82-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,800 kB
  • sloc: ansic: 103,536; perl: 2,720; sh: 783; yacc: 726; makefile: 715
file content (24 lines) | stat: -rw-r--r-- 574 bytes parent folder | download | duplicates (4)
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 /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