File: psad.postrm

package info (click to toggle)
psad 2.4.3-1.2~deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,884 kB
  • sloc: perl: 13,751; ansic: 1,322; sh: 342; makefile: 74
file content (36 lines) | stat: -rw-r--r-- 928 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
30
31
32
33
34
35
36
#!/bin/sh

set -e

# In case the user want to purge all files of the psad package, we must remove
# manually pid, fifo and log files before the main directories are removed.
if [ "$1" = "purge" ]; then
 
    # Handle the /var/run/psad directory that contains pid and socket files
    if [ -d /var/run/psad ];then
        find /var/run/psad/ -type f -exec rm {} \;
        find /var/run/psad/ -type s -exec rm {} \;
        rmdir /var/run/psad
    fi

    # Clean the config directory /etc/psad
    if [ -d /etc/psad/archive ]; then
        find /etc/psad/archive/ -type f -exec rm {} \;
        rmdir /etc/psad/archive
    fi

    # Remove the fifo file which psad creates
    if [ -d /var/lib/psad ]; then
        find /var/lib/psad -type p -exec rm {} \;
    fi

    # Handle the /var/log/psad directory that contains log files 
    if [ -d /var/log/psad ]; then
        rm -rf /var/log/psad/*
    fi

fi

#DEBHELPER#

exit 0