File: syslog-ng-core.preinst

package info (click to toggle)
syslog-ng 3.38.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 16,484 kB
  • sloc: ansic: 147,811; python: 8,307; makefile: 5,767; sh: 5,048; java: 3,646; xml: 3,344; yacc: 1,168; lex: 497; perl: 193; awk: 190
file content (34 lines) | stat: -rw-r--r-- 1,136 bytes parent folder | download | duplicates (3)
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
#! /bin/sh

set -e

if [ "$1" = "install" ]; then
    if [ -f /etc/logrotate.d/syslog-ng.disabled ]; then
        if [ -n "$2" ]; then
            mv -f /etc/logrotate.d/syslog-ng.disabled /etc/logrotate.d/syslog-ng
        elif [ ! -f /etc/logrotate.d/syslog-ng ]; then
            mv -f /etc/logrotate.d/syslog-ng.disabled /etc/logrotate.d/syslog-ng
        fi
    fi
    if [ -L /etc/systemd/system/syslog.service -a ! -e /etc/systemd/system/syslog.service ]; then
        rm /etc/systemd/system/syslog.service
    fi
fi

if [ "$1" = "upgrade" ] &&
   (dpkg --compare-versions "$2" lt "3.3.5-3" ||
    (dpkg --compare-versions "$2" gt "3.3.5-4" &&
     (dpkg --compare-versions "$2" lt "3.3.9-1~" || dpkg --compare-versions "$2" lt "3.4.2-1~")))
then
        # Some versions of the package installed symlink conffiles
        # which don't work (#690067)
        for file_to_remove in /etc/systemd/system/multi-user.target.wants/syslog-ng.service /etc/systemd/system/syslog.service; do
                if [ -L $file_to_remove ]; then
                        rm $file_to_remove
                fi
        done
fi

#DEBHELPER#

exit 0