summaryrefslogtreecommitdiff
path: root/nonsystemd/eudev/udev-hook
blob: d9c793f456b7b055b360f37fa7e5fb0b9db90ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh -e

udevd_live() {
  if [ ! -d /run/udev ]; then
    echo >&2 "  Skipped: Device manager is not running."
    exit 0
  fi
}

case $1 in
  hwdb)     /usr/bin/udevadm hwdb --update ;;
  udev-reload)   udevd_live;   /usr/bin/udevadm control --reload ;;
  *) echo >&2 "  Invalid operation '$1'"; exit 1 ;;
esac

exit 0