mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-29 13:02:35 +02:00
stop background torrent when loosing sync
This commit is contained in:
@@ -257,19 +257,6 @@ do
|
|||||||
secondsOutOfSync=$(echo "${actualSecondsTimestamp}-"${syncedSince} | bc)
|
secondsOutOfSync=$(echo "${actualSecondsTimestamp}-"${syncedSince} | bc)
|
||||||
#echo "${secondsOutOfSync} seconds"
|
#echo "${secondsOutOfSync} seconds"
|
||||||
|
|
||||||
# when >10min out of sync
|
|
||||||
if [ ${secondsOutOfSync} -gt 600 ]; then
|
|
||||||
#echo "! LND fell out of sync for longer then 10 minutes !"
|
|
||||||
if [ "${backupTorrentSeeding}" == "on" ]; then
|
|
||||||
#echo "Backup Torrent Seeding is ON - check if still running"
|
|
||||||
source <(sudo -u admin /home/admin/50torrentHDD.sh status)
|
|
||||||
if [ "${baseSeeding}" == "1" ] || [ "${updateSeeding}" == "1" ]; then
|
|
||||||
echo "---> STOPPING Backup Torrent Seeding"
|
|
||||||
sudo -u admin /home/admin/50torrentHDD.sh stop
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# when >1h out of sync
|
# when >1h out of sync
|
||||||
#if [ ${secondsOutOfSync} -gt 3600 ]; then
|
#if [ ${secondsOutOfSync} -gt 3600 ]; then
|
||||||
# echo "!!!! LND fell out of sync for longer then 1 hour !!!"
|
# echo "!!!! LND fell out of sync for longer then 1 hour !!!"
|
||||||
@@ -283,6 +270,16 @@ do
|
|||||||
echo "sync change detected"
|
echo "sync change detected"
|
||||||
if [ ${lastSyncState} -eq 1 ] && [ ${lndSynced} -eq 0 ]; then
|
if [ ${lastSyncState} -eq 1 ] && [ ${lndSynced} -eq 0 ]; then
|
||||||
echo "--> LND SYNC LOST"
|
echo "--> LND SYNC LOST"
|
||||||
|
|
||||||
|
if [ "${backupTorrentSeeding}" == "on" ]; then
|
||||||
|
#echo "Backup Torrent Seeding is ON - check if still running"
|
||||||
|
source <(sudo -u admin /home/admin/50torrentHDD.sh status)
|
||||||
|
if [ "${baseSeeding}" == "1" ] || [ "${updateSeeding}" == "1" ]; then
|
||||||
|
echo "---> STOPPING Backup Torrent Seeding"
|
||||||
|
sudo -u admin /home/admin/50torrentHDD.sh stop
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
if [ ${syncedSince} -eq 0 ]; then
|
if [ ${syncedSince} -eq 0 ]; then
|
||||||
echo "--> LND SYNC GAINED"
|
echo "--> LND SYNC GAINED"
|
||||||
|
Reference in New Issue
Block a user