File: hotplug.preinst

package info (click to toggle)
hotplug 0.0.20040329-26
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 480 kB
  • ctags: 22
  • sloc: sh: 652; makefile: 183
file content (54 lines) | stat: -rw-r--r-- 1,490 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh -e

remove_old_rc_links() {
  [ "$2" ] || return

  if dpkg --compare-versions $2 lt 0.0.20040329-22; then
    # Because of repeated errors in debian/rules, this file was installed
    # in the wrong place.
    if [ -d /etc/modprobe.d/isapnp/ ]; then
      mv /etc/modprobe.d/isapnp/ /etc/modprobe.d/isapnp-backup
      if [ -f /etc/modprobe.d/isapnp-backup/isapnp.aliases ]; then
	mv /etc/modprobe.d/isapnp-backup/isapnp.aliases /etc/modprobe.d/isapnp
      fi
      rmdir /etc/modprobe.d/isapnp-backup/ || true
    fi
  fi
  if dpkg --compare-versions $2 lt 0.0.20040329-21; then
    rm -f /etc/hotplug/net.rc
  fi
  if dpkg --compare-versions $2 lt 0.0.20040329-17; then
    # stop scripts have been removed with 0.0.20040329-17
    rm -f /etc/rc?.d/K89hotplug
    # and the flag file has been moved
    if [ -e /etc/hotplug/net.enable ]; then
      mkdir -p /etc/hotplug/.run/
      mv /etc/hotplug/net.enable /etc/hotplug/.run/
    fi
  fi
  if dpkg --compare-versions $2 lt 0.0.20040311-8; then
    # These links are not needed anymore since 0.0.20040311-4, when support
    # for /etc/nohotplug was removed and the script was moved from S36 to S40.
    rm -f /etc/rc?.d/S11hotplug
    if [ -h /etc/rcS.d/S36hotplug ]; then
       mv /etc/rcS.d/S36hotplug /etc/rcS.d/S40hotplug
    fi
  fi
}


case "$1" in
  install)
  ;;

  upgrade|abort-upgrade)
  remove_old_rc_links "$@"
  ;;

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

#DEBHELPER#