From f94be5b7e6947058ff36518dcf7a8113fb4c9497 Mon Sep 17 00:00:00 2001 From: simon987 Date: Wed, 1 Jul 2020 14:25:54 -0400 Subject: [PATCH] deluge script, update update script --- old/deluge_tweak.sh | 29 +++++++++++++++++++++++++++++ sc_update | 12 +++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 old/deluge_tweak.sh diff --git a/old/deluge_tweak.sh b/old/deluge_tweak.sh new file mode 100644 index 0000000..623a3c1 --- /dev/null +++ b/old/deluge_tweak.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +torrentid=$1 +torrentname=$2 +torrentpath=$3 +x=1 +ddport=$(grep '"daemon_port": [0-9]*' ~/.config/deluge/core.conf | awk -F ': ' '{print $2}' | awk -F ',' '{print $1}') + +while [ $x -le 100 ] +do +sleep 2 + +echo "Running $x times" >> ~/script.log +echo "TorrentID: $torrentid" >> ~/script.log +line=$(deluge-console "connect 127.0.0.1:$ddport; info" $1 | grep "Tracker status") +echo $line >> ~/script.log +case "$line" in +*unregistered*|*Sent*|*End*of*file*|*Bad*Gateway*) +deluge-console "connect 127.0.0.1:$ddport; pause '$torrentid'" +sleep 2 +deluge-console "connect 127.0.0.1:$ddport; resume '$torrentid'" +;; +*) +echo "Found working torrent: $torrentname $torrentpath $torrentid" >> ~/script.log +exit 1;; +esac +x=$(( $x + 1 )) +done + diff --git a/sc_update b/sc_update index b1cf58e..2495ab5 100755 --- a/sc_update +++ b/sc_update @@ -1,5 +1,7 @@ -sudo pacman -S archlinux-keyring --noconfirm -sudo pacman-key --init --noconfirm -sudo pacman-key --populate archlinux --noconfirm -sudo pacman-key --refresh-keys --noconfirm -sudo pacman -Syyu --noconfirm +sudo su <