summaryrefslogtreecommitdiff
path: root/libre/systemd/udev-hook
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-07-12 17:19:36 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-07-12 17:19:36 -0400
commit759a6fc45aedef6cf6223c8c03f1737d1896f15d (patch)
tree625ec95c441aa0060916f2b6d7eef5d3aa07f241 /libre/systemd/udev-hook
parent36874999c237bac6bed665e4380ad5004e46fd4b (diff)
parenta51a45f18643194977b898d44ca94a88ce1105ca (diff)
downloadabslibre-759a6fc45aedef6cf6223c8c03f1737d1896f15d.tar.gz
abslibre-759a6fc45aedef6cf6223c8c03f1737d1896f15d.tar.bz2
abslibre-759a6fc45aedef6cf6223c8c03f1737d1896f15d.zip
Merge branch 'lukeshu/systemd-split'
Diffstat (limited to 'libre/systemd/udev-hook')
-rw-r--r--libre/systemd/udev-hook18
1 files changed, 18 insertions, 0 deletions
diff --git a/libre/systemd/udev-hook b/libre/systemd/udev-hook
new file mode 100644
index 000000000..61d853293
--- /dev/null
+++ b/libre/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