File: munin-node.postrm

package info (click to toggle)
munin 2.999.14-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 10,036 kB
  • sloc: perl: 31,052; sh: 12,473; java: 1,924; python: 852; makefile: 336; ruby: 232; awk: 169; xml: 45; sql: 11
file content (27 lines) | stat: -rwxr-xr-x 635 bytes parent folder | download
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
#! /bin/sh

set -e

delete_dir_if_empty() {
    if [ -d "$1" ]; then
        rmdir --ignore-fail-on-non-empty "$1"
    fi
}

if [ "$1" = "purge" ]; then
    if [ -d /etc/munin/plugins ]; then
        find /etc/munin/plugins -type l -xtype l -delete
    fi

    rm -rf /var/lib/munin-node/plugin-state
    rm -f /var/log/munin-node/munin-node.log*
    rm -f /var/log/munin-node/munin-node-configure.log*

    delete_dir_if_empty /var/lib/munin-node
    delete_dir_if_empty /var/log/munin-node
    delete_dir_if_empty /etc/munin/plugin-conf.d
    delete_dir_if_empty /etc/munin/plugins
    delete_dir_if_empty /etc/munin
fi

#DEBHELPER#