add timeout to prevent script from blocking

This commit is contained in:
root 2025-10-22 17:27:48 +02:00
parent 1f16f36483
commit 0850627dab

View file

@ -87,7 +87,7 @@ case $STATUS in
;;
esac
BEVERAGE_SUPPLY="$(wget -O- "$YAMMAT_JSON_URL" 2>/dev/null | jq -rc "[ .[] | select( . | .amount > 0 ) | { value: .amount, unit: \"btl\", name: .name, description: ([(.price/100), \"€\"]|join(\" \")) } ]")"
BEVERAGE_SUPPLY="$(wget --timeout 50 --tries 1 -O- "$YAMMAT_JSON_URL" 2>/dev/null | jq -rc "[ .[] | select( . | .amount > 0 ) | { value: .amount, unit: \"btl\", name: .name, description: ([(.price/100), \"€\"]|join(\" \")) } ]")"
if [ -z "$BEVERAGE_SUPPLY" ]; then
BEVERAGE_SUPPLY="$(cat $BEVERAGE_SUPPLY_TMP)"
else