diff --git a/enable_wol_proxmox.sh b/enable_wol_proxmox.sh index 0665dbc..7f8df19 100644 --- a/enable_wol_proxmox.sh +++ b/enable_wol_proxmox.sh @@ -193,10 +193,10 @@ fi info "Verifying WOL is enabled on ${PRIMARY_IF}..." VERIFY_OUTPUT=$(ethtool "$PRIMARY_IF") -WAKE_ON=$(awk -F: '/Wake-on/ {gsub(/ /,"",$2); print $2}' <<<"$VERIFY_OUTPUT") +WAKE_ON=$(awk -F: '$1 ~ /^[[:space:]]*Wake-on$/ {gsub(/ /,"",$2); print $2; exit}' <<<"$VERIFY_OUTPUT") -if [[ "$WAKE_ON" != "g" ]]; then - err "WOL verification failed: Wake-on is '${WAKE_ON}', expected 'g'. Check BIOS settings and /etc/network/interfaces." +if [[ "$WAKE_ON" != *g* ]]; then + err "WOL verification failed: Wake-on is '${WAKE_ON}', expected to include 'g'. Check BIOS settings and /etc/network/interfaces." fi info "WOL verification succeeded: Wake-on is '${WAKE_ON}'."