From 8c2a3cc4d774fa13d17f695d6bdf9a4deedb1372 Mon Sep 17 00:00:00 2001 From: tteckster Date: Fri, 16 Jun 2023 14:11:38 -0400 Subject: [PATCH] Update monitor-all.sh Skip instances based on onboot and templates --- misc/monitor-all.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/misc/monitor-all.sh b/misc/monitor-all.sh index 9eec0d1a..65dbca92 100644 --- a/misc/monitor-all.sh +++ b/misc/monitor-all.sh @@ -49,9 +49,14 @@ while true; do IP=$(qm guest cmd $instance network-get-interfaces | egrep -o "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -E "192\.|10\." | head -n 1) fi - # Skip instances based on templates + # Skip instances based on onboot and templates + onboot=$($config_cmd $instance | grep onboot | grep -q "onboot: 0" && echo "true" || echo "false") template=$($config_cmd $instance | grep template | grep -q "template:" && echo "true" || echo "false") - if [ "$template" == "true" ]; then + + if [ "$onboot" == "true" ]; then + echo "Skipping $instance because it is set not to boot" + continue + elif [ "$template" == "true" ]; then echo "Skipping $instance because it is a template" continue fi