Update cron scripts
This commit is contained in:
parent
7f2a5238c6
commit
500d9705bf
2 changed files with 9 additions and 1 deletions
|
@ -5,12 +5,18 @@ source /Users/noahheague/.config/scripts/util/secret.sh
|
|||
API_KEY=$(getSecret "/server/mac-mini-1/seed-api-key")
|
||||
API_URL=$(getSecret "/server/mac-mini-1/seed-api-url")
|
||||
|
||||
echo $API_URL
|
||||
echo $API_KEY
|
||||
|
||||
SEED_COUNT=$(curl --request GET \
|
||||
--silent \
|
||||
--url "$API_URL" \
|
||||
--header "X-API-Key: $API_KEY" \
|
||||
--header "Cache-Control: no-cache" \
|
||||
| jq ".response.community.seeding")
|
||||
|
||||
echo $SEED_COUNT
|
||||
|
||||
if [ "$SEED_COUNT" = "null" ]; then
|
||||
if [ ! -f /tmp/seed-timestamp.txt ]; then
|
||||
echo $TIME > /tmp/seed-timestamp.txt;
|
||||
|
@ -19,6 +25,8 @@ if [ "$SEED_COUNT" = "null" ]; then
|
|||
-c "torrent" \
|
||||
-m "Seeding has paused!"
|
||||
|
||||
/usr/local/bin/docker restart $(/usr/local/bin/docker ps | grep deluge | cut -d' ' -f1)
|
||||
|
||||
fi;
|
||||
|
||||
SAVED_TIME=$(cat /tmp/seed-timestamp.txt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue