From 1fdb07e6c0c7a41e67dab3f633409c55f493aaa7 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Fri, 8 Nov 2024 08:43:01 -0600 Subject: [PATCH] Remove SSH code --- update_tracker.py | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/update_tracker.py b/update_tracker.py index c19c482..91fed7e 100755 --- a/update_tracker.py +++ b/update_tracker.py @@ -30,7 +30,7 @@ Examples: """ import json -import subprocess +import shutil import tempfile from pathlib import Path @@ -82,33 +82,12 @@ if __name__ == "__main__": with open(ntf.name, "w") as tf: tf.writelines(format_infohashes) - # Use scp to copy the infohashes file to the torrent tracker's config - # directory on the remote torrent tracker server, overwriting the - # whitelist.txt file + # Use shutil.copy to copy the infohashes file to the torrent tracker's config + # directory, overwriting the whitelist.txt file. console.log( - "SSH-copying the temporary infohashes file to the torrent tracker's whitelist." - ) - subprocess.run( - [ - "scp", - "-q", - ntf.name, - f"root@{tracker_domain}:/etc/opentracker/whitelist.txt", - ] - ) - - # Use SSH to run `systemctl restart opentracker.service` on the remote - # torrent tracker server - console.log("Restarting opentracker.service on the remote server.") - subprocess.run( - [ - "ssh", - f"root@{tracker_domain}", - "systemctl", - "restart", - "opentracker.service", - ] + "Copying the temporary infohashes file to the torrent tracker's whitelist." ) + shutil.copy(ntf.name, "/etc/opentracker/whitelist.txt") # Reannounce all torrents in each qBittorrent instance to their trackers console.log("Reannouncing all torrents to their trackers.")