diff --git a/.config/scripts/cron/seed-status.sh b/.config/scripts/cron/seed-status.sh index b752bdf..8a805cb 100755 --- a/.config/scripts/cron/seed-status.sh +++ b/.config/scripts/cron/seed-status.sh @@ -1,4 +1,5 @@ TIME=$(date +%s) +ALERT_GAP=86400 source /Users/noahheague/.config/scripts/util/secret.sh API_KEY=$(getSecret "/server/mac-mini-1/seed-api-key") @@ -10,7 +11,7 @@ SEED_COUNT=$(curl --request GET \ --header "X-API-Key: $API_KEY" \ | jq ".response.community.seeding") -if [ "$SEED_COUNT" -le "0" ]; then +if [ "$SEED_COUNT" = "null" ]; then if [ ! -f /tmp/seed-timestamp.txt ]; then echo $TIME > /tmp/seed-timestamp.txt; @@ -21,7 +22,7 @@ if [ "$SEED_COUNT" -le "0" ]; then fi; SAVED_TIME=$(cat /tmp/seed-timestamp.txt) - SAVED_TIME_PLUS=$(( $SAVED_TIME + 86400 )); + SAVED_TIME_PLUS=$(( $SAVED_TIME + $ALERT_GAP )); if [ $TIME -ge $SAVED_TIME_PLUS ]; then echo $TIME > /tmp/seed-timestamp.txt;