Remove SSH code

This commit is contained in:
Jeffrey Serio 2024-11-08 08:43:01 -06:00
parent 90db8fbda4
commit 1fdb07e6c0

View File

@ -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.")