From 1f18d594c916c7a519833d0657b360c353c93422 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 4 Mar 2021 00:53:27 -0500 Subject: don't leave inotifywait processes around --- bin/hornet/watch-kbd | 7 +++++-- 1 file 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 -- cgit v1.2.3-54-g00ecf