Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
Update monitor-all.sh
Browse files Browse the repository at this point in the history
Skip instances based on onboot and templates
  • Loading branch information
tteck authored Jun 16, 2023
1 parent 0d5754d commit 8c2a3cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions misc/monitor-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c2a3cc

Please sign in to comment.