udev-hook 395 B

12345678910111213141516171819202122
  1. #!/bin/sh -e
  2. udevd_live() {
  3. if [ ! -d /run/udev ]; then
  4. echo >&2 " Skipped: Device manager is not running."
  5. exit 0
  6. fi
  7. }
  8. op="$1"; shift
  9. case "$op" in
  10. #hwdb) /usr/bin/udev-hwdb --usr update ;;
  11. hwdb) /usr/bin/udevadm hwdb --update ;;
  12. udev-reload) udevd_live; /usr/bin/udevadm control --reload ;;
  13. *) echo >&2 " Invalid operation '$op'"; exit 1 ;;
  14. esac
  15. exit 0