diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index ad780ab..94396bf 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -222,7 +222,7 @@ if [ "${backupTorrentSeeding}" != "${choice}" ]; then echo "BACKUP TORRENT SEEDING Setting changed .." anychange=1 if [ "${choice}" = "on" ]; then - sudo /home/admin/50torrentHDD.sh backup-torrent-hosting + /home/admin/50torrentHDD.sh backup-torrent-hosting dialog --backtitle "RaspiBlitz Settings" --title " OK " --msgbox " BACKUP TORRENT SEEDING IS NOW ACTIVE @@ -237,7 +237,7 @@ RaspiBlitz can be slow. else echo "Stopping Torrents and Cleaning Up ..." - sudo /home/admin/50torrentHDD.sh backup-torrent-hosting-cleanup + /home/admin/50torrentHDD.sh backup-torrent-hosting-cleanup echo "BACKUP TORRENT SEEDING IS NOW OFF" needsReboot=1 fi diff --git a/home.admin/50torrentHDD.sh b/home.admin/50torrentHDD.sh index 3a8c269..dbc8ba4 100755 --- a/home.admin/50torrentHDD.sh +++ b/home.admin/50torrentHDD.sh @@ -62,6 +62,25 @@ if [ "$1" == "backup-torrent-hosting-cleanup" ]; then echo "DONE" exit fi +if [ "$1" == "backup-torrent-hosting-status" ]; then + sessionPID=$(screen -ls | grep "blockchain" | cut -d "." -f1 | xargs) + if [ ${#sessionPID} -gt 0 ]; then + echo "baseSeeding=1" + else + echo "baseSeeding=0" + fi + torrentComplete=$(cat ${sessionDir}/blockchain/*.torrent.rtorrent | grep ':completei1' -c) + echo "baseComplete=${torrentComplete}" + sessionPID=$(screen -ls | grep "update" | cut -d "." -f1 | xargs) + if [ ${#sessionPID} -gt 0 ]; then + echo "updateSeeding=1" + else + echo "updateSeeding=0" + fi + torrentComplete=$(cat ${sessionDir}/update/*.torrent.rtorrent | grep ':completei1' -c) + echo "updateComplete=${torrentComplete}" + exit +fi # if setup was done - remove old data if [ "${setupStep}" = "100" ] && [ ${#1} -eq 0 ]; then diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 857096f..acc4956 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -441,7 +441,7 @@ sudo /home/admin/config.scripts/blitz.stresstest.sh /home/admin/stresstest.repor if [ "${backupTorrentSeeding}" == "on" ]; then echo "Starting BACKUP TORRENT HOSTING in background (after 6 hours) ..." >> $logFile - ( sleep 6h ; sudo /home/admin/50torrentHDD.sh backup-torrent-hosting ) & + ( sleep 6h ; sudo -u admin /home/admin/50torrentHDD.sh backup-torrent-hosting ) & fi echo "DONE BOOTSTRAP" >> $logFile