summaryrefslogtreecommitdiff
path: root/pcr/eudev/udev-hook
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/eudev/udev-hook')
-rw-r--r--pcr/eudev/udev-hook16
1 files changed, 16 insertions, 0 deletions
diff --git a/pcr/eudev/udev-hook b/pcr/eudev/udev-hook
new file mode 100644
index 000000000..d9c793f45
--- /dev/null
+++ b/pcr/eudev/udev-hook
@@ -0,0 +1,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