#!/bin/bash
BTTRACK=/usr/bin/bttrack.bittorrent
BTSEEDER=/usr/bin/btlaunchmany.bittornado
BTTRACKPORT=6969
BTTRACKDFILE=/tmp/dstate
BTINTERVAL=10
BTTORRENTSDIR=/opt/opengnsys/images
# Desactivar descarga de torrents desde clientes no autorizados.
BTALLOW_GET=0
# parametros basados en EAC 05-04-2009 antonio doblas viso.
BTTRACK_OPTIONS=" --save_dfile_interval $BTINTERVAL --timeout_downloaders_interval $BTINTERVAL --port $BTTRACKPORT --dfile $BTTRACKDFILE --reannounce_interval $BTINTERVAL --allowed_dir $BTTORRENTSDIR --allow_get $BTALLOW_GET "
BTTRACKPID="/var/run/bttrack.pid"
BTSEEDERPID="/var/run/btseeder.pid"

###################  #######################################

systemctl --user stop bttrack.service
rm -f $BTTRACKDFILE
sleep 2
systemd-run --user --unit bttrack.service --wait bttrack $BTTRACK_OPTIONS
