Browse Source

remove sudo from background torrent

master
Christian Rotzoll 6 years ago
parent
commit
ed154c736b
  1. 4
      home.admin/00settingsMenuServices.sh
  2. 19
      home.admin/50torrentHDD.sh
  3. 2
      home.admin/_bootstrap.sh

4
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

19
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

2
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

Loading…
Cancel
Save