From e686dbaf9de56da2ebbde6206b8e3f1c9af05416 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Tue, 7 Dec 2021 20:11:53 +0100 Subject: [PATCH] More transmission monitoring steps --- seqs/transmission.sh | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/seqs/transmission.sh b/seqs/transmission.sh index 038d86c..d123b4e 100755 --- a/seqs/transmission.sh +++ b/seqs/transmission.sh @@ -5,6 +5,7 @@ toolDeps=transmission-daemon toolService=transmission-daemon toolUser=debian-transmission toolCronLoc="/etc/cron.d/transmission_daemon" +toolRemote="$(command -v transmission-remote)" # Get script working directory # (when called from a different directory) @@ -49,6 +50,16 @@ step_10() { addConf -s "$TRDA_CRON" "$toolCronLoc" } +step_11_info() { echo "Setup remote authentication for current user (~/.netrc)"; } +step_11_alias() { ALIAS="netrcauth"; } +step_11() { + local lRemoteAuth="$(realpath ~/.netrc)" + if [ ! -f "$lRemoteAuth" ]; then + addConf -s "$TRDA_REMOTE_AUTH" "$lRemoteAuth" + [ $? -eq 0 ] && exe chmod 600 "$lRemoteAuth" + fi +} + step_12_info() { echo "Add ufw rules for rpc and peer port (default 9091 and 51413)"; } step_12_alias() { ALIAS="ufw"; } step_12() { @@ -100,5 +111,33 @@ net.core.wmem_max = 1048576 NOTES_EOF } -VERSION_SEQREV=12 +step_50_info() { echo "List all available torrents"; } +step_50_alias() { ALIAS="list"; } +step_50() { + step netrcauth + outColor green + exe "$toolRemote" -l +} + +step_52_info() { echo "List information about [TORRENT ID]"; } +step_52_alias() { ALIAS="info"; } +step_52() { + shift + endCheckEmpty 1 "Id must not be empty" + + step netrcauth + outColor green + exep "\"$toolRemote\" -t$1 -i | less" +} + +step_54_info() { echo "$toolName status"; } +step_54_alias() { ALIAS="status"; } +step_54() { + step netrcauth + outColor green + exe "$toolRemote" -si + exe "$toolRemote" -st +} + +VERSION_SEQREV=13 . /usr/local/bin/sequencer.sh