summaryrefslogtreecommitdiff
path: root/libre-testing/systemd/udev-hook
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2019-01-15 23:38:03 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2019-01-15 23:38:03 -0500
commitb1287b34794130a1ff32f61a1ba30b9a830466c1 (patch)
tree61fea481960a33e8d912cb4a127aec62d0b252df /libre-testing/systemd/udev-hook
parent4efabdd4fcc19c30b09f49d1ec4d69fb110e8e29 (diff)
downloadabslibre-b1287b34794130a1ff32f61a1ba30b9a830466c1.tar.gz
abslibre-b1287b34794130a1ff32f61a1ba30b9a830466c1.tar.bz2
abslibre-b1287b34794130a1ff32f61a1ba30b9a830466c1.zip
copy systemd to [libre-testing]
Diffstat (limited to 'libre-testing/systemd/udev-hook')
-rw-r--r--libre-testing/systemd/udev-hook18
1 files changed, 18 insertions, 0 deletions
diff --git a/libre-testing/systemd/udev-hook b/libre-testing/systemd/udev-hook
new file mode 100644
index 000000000..61d853293
--- /dev/null
+++ b/libre-testing/systemd/udev-hook
@@ -0,0 +1,18 @@
+#!/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/systemd-hwdb --usr update ;;
+
+ udev-reload) udevd_live; /usr/bin/udevadm control --reload ;;
+
+ *) echo >&2 " Invalid operation '$1'"; exit 1 ;;
+esac
+
+exit 0