File: sysconfig-hardware.preinst

package info (click to toggle)
sysconfig 0.0.14
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 120 kB
  • sloc: sh: 501; makefile: 43
file content (32 lines) | stat: -rw-r--r-- 747 bytes parent folder | download | duplicates (6)
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
#!/bin/sh

set -e

case "$1" in
    install|upgrade)
        if [ -e "/etc/udev/sysconfig-hardware.rules" ]; then
            if [ "$(md5sum "/etc/udev/sysconfig-hardware.rules" | sed -e "s/ .*//")" = \
                 "$(dpkg-query -W -f='${Conffiles}' sysconfig-hardware | sed -n -e "\\' /etc/udev/sysconfig-hardware.rules's/.* //p")" ]
            then
                rm -f "/etc/udev/sysconfig-hardware.rules"
            fi
        fi
        if [ -L "/etc/udev/rules.d/z60_sysconfig-hardware.rules" ]; then
            rm -f "/etc/udev/rules.d/z60_sysconfig-hardware.rules"
        fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0