Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
Created November 8, 2020 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfeilbach/e7b084b2cdb949b7cc610ea9637d1d36 to your computer and use it in GitHub Desktop.
Save jfeilbach/e7b084b2cdb949b7cc610ea9637d1d36 to your computer and use it in GitHub Desktop.
Purge old torrents from host
#!/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