Created
November 8, 2020 23:28
-
-
Save jfeilbach/e7b084b2cdb949b7cc610ea9637d1d36 to your computer and use it in GitHub Desktop.
Purge old torrents from host
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 | |
NC='\033[0m' # No color | |
Green='\033[0;32m' # Green | |
White='\033[0;37m' # White | |
Red='\033[0;31m' # Red | |
check=$(/usr/bin/transmission-remote uhura.local:9091 -l | grep 'Stopped' | awk '{ ORS=" " } ; { print $1 }') | |
usage=$(df -h |grep dl | awk '{ print $5,$6 }') | |
for x in ${check} ; do | |
name=$(/usr/bin/transmission-remote uhura.local:9091 -t ${x} -i |grep 'Name:') | |
echo -e "${Red}Warning. Delete --> ${NC}${White}${name}${NC}" | |
/usr/bin/transmission-remote uhura.local:9091 -t ${x} -rad | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment