Fix issues with seed status script

This commit is contained in:
Pfych 2024-08-29 15:36:38 +10:00
parent c54c4d785f
commit 06b1c8e98a

View File

@ -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