my-scripts/trans-init

22 lines
637 B
Plaintext
Raw Permalink Normal View History

2022-09-19 02:13:02 +00:00
#!/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 &