my-scripts/trans-init

22 lines
637 B
Bash
Executable File

#!/usr/bin/env sh
#sleep 30
[ ! -d ~/.cache/transmission ] && mkdir -p ~/.cache/transmission
while [ ! -f ~/.cache/transmission/bt_blocklists.gz ]; do
sleep 10
cd ~/.cache/transmission/
curl -O -L https://github.com/Naunter/BT_BlockLists/raw/master/bt_blocklists.gz
done
gunzip ~/.cache/transmission/bt_blocklists.gz
rm ~/.cache/transmission/bt_blocklists.gz
if [ -f ~/.config/transmission-daemon/blocklists/bt_blocklists ]; then
rm ~/.config/transmission-daemon/blocklists/*
fi
mv ~/.cache/transmission/bt_blocklists ~/.config/transmission-daemon/blocklists/
[ -z "$(pgrep transmission)" ] && transmission-daemon &