diff --git a/.config/scripts/cron/seed-status.sh b/.config/scripts/cron/seed-status.sh index e7e76b8..b752bdf 100755 --- a/.config/scripts/cron/seed-status.sh +++ b/.config/scripts/cron/seed-status.sh @@ -13,17 +13,23 @@ SEED_COUNT=$(curl --request GET \ if [ "$SEED_COUNT" -le "0" ]; then if [ ! -f /tmp/seed-timestamp.txt ]; then echo $TIME > /tmp/seed-timestamp.txt; + + /Users/noahheague/.config/scripts/util/webhook.sh \ + -c "torrent" \ + -m "Seeding has paused!" + fi; SAVED_TIME=$(cat /tmp/seed-timestamp.txt) - echo "Saved Timestamp: $SAVED_TIME" - echo "Current Time: $TIME" SAVED_TIME_PLUS=$(( $SAVED_TIME + 86400 )); - echo "Plus: $SAVED_TIME_PLUS" + + if [ $TIME -ge $SAVED_TIME_PLUS ]; then + echo $TIME > /tmp/seed-timestamp.txt; - if [ $SAVED_TIME_PLUS -ge $TIME ]; then - Users/noahheague/.config/scripts/util/webhook.sh \ + /Users/noahheague/.config/scripts/util/webhook.sh \ -c "torrent" \ - -m "Seeding has been paused." + -m "Seeding is still paused!" fi +else + rm /tmp/seed-timestamp.txt 2> /dev/null || true fi