From d406ce795cf440d5a406a55fbee42adebc374762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20J=C3=A4ger?= Date: Sun, 20 Nov 2022 21:34:40 +0100 Subject: [PATCH] grub-btrfsd: error when inotifywait is not found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #227 Signed-off-by: Pascal Jäger --- grub-btrfsd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grub-btrfsd b/grub-btrfsd index 5988059..f47df03 100755 --- a/grub-btrfsd +++ b/grub-btrfsd @@ -120,6 +120,12 @@ shift $(( OPTIND - 1 )) snapshots="${1}" +# check if inotify exists, see issue #227 +if ! command -v inotifywait &> /dev/null; then + err "[!] inotifywait was not found, exiting. Is inotify-tools installed?" "${RED}" >&2 + exit 1 +fi + if [ ${#logfile} -gt 1 ]; then touch "${logfile}" echo "GRUB-BTRFSD log $(date)" >> "${logfile}"