Created
July 29, 2023 13:13
-
-
Save kantjer01/59d3781598aa59cb460427f5e30e30df to your computer and use it in GitHub Desktop.
upgraderr-reannounce.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will reannounce the imported torrents on the localhost. | |
# load variables | |
set -o allexport | |
source /volume1/scripts/upgraderr/upgraderr.env | |
set +o allexport | |
log="$log_dir/reannounce.$(date +"%Y-%m-%d_%H.%M").log" | |
# Reannounce imported movies torrents on localhost | |
echo "Reannounce imported movies torrents on localhost" | tee $log | |
curl -X POST -H "Content-Type: application/json" -d @- "$webhook_url" <<CURL_DATA | tee -a $log | |
{"host":"${host_movies_local}", | |
"user":"${user_local}", | |
"password":"${password_local}", | |
"action":"reannounce", | |
"query":"DisableCrossseed() && Tags contains 'imported'"} | |
CURL_DATA | |
# Reannounce imported series torrents on localhost | |
echo "Reannounce imported series torrents on localhost" | tee -a $log | |
curl -X POST -H "Content-Type: application/json" -d @- "$webhook_url" <<CURL_DATA | tee -a $log | |
{"host":"${host_series_local}", | |
"user":"${user_local}", | |
"password":"${password_local}", | |
"action":"reannounce", | |
"query":"DisableCrossseed() && Tags contains 'imported'"} | |
CURL_DATA | |
# cleanup log files | |
if ls -t $log_dir/reannounce.*.log &>/dev/null; then | |
ls -t $log_dir/reannounce.*.log | tail -n +4 | xargs rm -f -- | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment