remove sudo from background torrent

This commit is contained in:
Christian Rotzoll 2019-04-11 23:06:56 +01:00
parent f6c99818eb
commit ed154c736b
3 changed files with 22 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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