mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-25 07:07:46 +01:00
screen fix
This commit is contained in:
parent
67cda46ba0
commit
868f02ce96
1 changed files with 6 additions and 6 deletions
|
@ -21,12 +21,11 @@ if [ "$network" = "litecoin" ]; then
|
|||
fi
|
||||
|
||||
# screen background monitoring settings
|
||||
name="torrent"
|
||||
name="Torrent"
|
||||
targetDir="/mnt/hdd/torrent"
|
||||
targetSize=$size
|
||||
maxTimeoutLoops=100000
|
||||
#command="bash -c 'sudo lftp -c \"torrent -O ${targetDir} /home/admin/assets/${torrent}.torrent; bye\"'"
|
||||
command="bash -c 'sudo ls'"
|
||||
command="sudo lftp -c \"torrent -O ${targetDir} /home/admin/assets/${torrent}.torrent; bye\""
|
||||
|
||||
# starting session if needed
|
||||
echo "checking if ${name} has a running screen session"
|
||||
|
@ -36,8 +35,9 @@ echo "isRunning(${isRunning})"
|
|||
if [ ${isRunning} -eq 0 ]; then
|
||||
echo "Starting screen session"
|
||||
sudo mkdir ${targetDir} 2>/dev/null
|
||||
echo "screen -S ${name} -dm ${command}"
|
||||
screen -S ${name} -dm ${command}
|
||||
screenCommand="screen -S ${name} -L screen.log -dm ${command}"
|
||||
echo "${screenCommand}"
|
||||
bash -c "${screenCommand}"
|
||||
else
|
||||
echo "Continue screen session"
|
||||
fi
|
||||
|
@ -123,7 +123,7 @@ if [ ${isRunning} -eq 1 ]; then
|
|||
sessionPID=$(screen -ls | grep "${name}" | cut -d "." -f1 | xargs)
|
||||
echo "killing screen session PID(${sessionPID})"
|
||||
# kill all child processes of screen sceesion
|
||||
pkill -P ${sessionPID}
|
||||
sudo pkill -P ${sessionPID}
|
||||
echo "proccesses klilled"
|
||||
sleep 3
|
||||
# tell the screen session to quit and wait a bit
|
||||
|
|
Loading…
Add table
Reference in a new issue