summaryrefslogtreecommitdiff
path: root/nonsystemd/xudev/udev-hook
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2021-07-02 17:59:23 -0400
committerDavid P <megver83@parabola.nu>2021-07-02 17:59:23 -0400
commit1df0f6aa746f3ce433684f82b6972cdb1c2b600e (patch)
tree76bfa75ed8d06ccaa8ec1a02d47bd82a5bf469e8 /nonsystemd/xudev/udev-hook
parent35f42abda206ca81bb32a886f1fc4b8463d828c1 (diff)
downloadabslibre-1df0f6aa746f3ce433684f82b6972cdb1c2b600e.tar.gz
abslibre-1df0f6aa746f3ce433684f82b6972cdb1c2b600e.tar.bz2
abslibre-1df0f6aa746f3ce433684f82b6972cdb1c2b600e.zip
addpkg: nonsystemd/xudev 248.3-1
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'nonsystemd/xudev/udev-hook')
-rw-r--r--nonsystemd/xudev/udev-hook21
1 files changed, 21 insertions, 0 deletions
diff --git a/nonsystemd/xudev/udev-hook b/nonsystemd/xudev/udev-hook
new file mode 100644
index 000000000..327039741
--- /dev/null
+++ b/nonsystemd/xudev/udev-hook
@@ -0,0 +1,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