summaryrefslogtreecommitdiff
path: root/nonsystemd/xudev/udev-hook
blob: 3270397413386e9284fadbcd21a68feede6af99d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh -e

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

op="$1"; shift

case "$op" in
  #hwdb)     /usr/bin/udev-hwdb --usr update ;;
  hwdb)     /usr/bin/udevadm hwdb --update ;;

  udev-reload)   udevd_live;   /usr/bin/udevadm control --reload ;;

  *) echo >&2 "  Invalid operation '$op'"; exit 1 ;;
esac

exit 0