summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-04 00:53:27 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-04 00:53:27 -0500
commit1f18d594c916c7a519833d0657b360c353c93422 (patch)
tree5250221dc73c165df85a939595a91814249363f5
parent79ce206930109632530fc1df962a6c932eb96507 (diff)
downloadconf-1f18d594c916c7a519833d0657b360c353c93422.tar.gz
conf-1f18d594c916c7a519833d0657b360c353c93422.zip
don't leave inotifywait processes around
-rwxr-xr-xbin/hornet/watch-kbd7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/hornet/watch-kbd b/bin/hornet/watch-kbd
index cbb3824..d5cd583 100755
--- a/bin/hornet/watch-kbd
+++ b/bin/hornet/watch-kbd
@@ -1,11 +1,14 @@
-#!/bin/sh
+#!/bin/bash
set -eu
set -o pipefail
+trap 'kill $(jobs -p)' EXIT
+
inotifywait -mq -e create -e delete --exclude '.*tmp.*' /dev/input/by-id/ | \
while read -r event; do
echo "$event"
if echo "$event" | grep -q USB_Keyboard; then
setup-inputs
fi
- done
+ done &
+wait