diff --git a/libvirt_hooks/qemu b/libvirt_hooks/qemu index 365bf97..c4a6c27 100755 --- a/libvirt_hooks/qemu +++ b/libvirt_hooks/qemu @@ -18,9 +18,11 @@ BASEDIR="$(dirname $0)" HOOKPATH="$BASEDIR/qemu.d/$GUEST_NAME/$HOOK_NAME/$STATE_NAME" +set -e # If a script exits with an error, we should as well. + if [ -f "$HOOKPATH" ]; then eval "$HOOKPATH" "$@" elif [ -d "$HOOKPATH" ]; then - find -L "$HOOKPATH" -type f -executable -exec {} "$@" \; + find -L "$HOOKPATH" -maxdepth 1 -type f -executable -exec {} "$@" \; fi