From bb2ced1f841fb583297633f0a57af7d7bfe682fc Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 5 Sep 2018 20:06:48 +0200 Subject: [PATCH] check pid --- home.admin/50torrentHDD.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/50torrentHDD.sh b/home.admin/50torrentHDD.sh index 9659edb..cd24cc7 100755 --- a/home.admin/50torrentHDD.sh +++ b/home.admin/50torrentHDD.sh @@ -24,7 +24,7 @@ echo "" # check if lftp is running in background pid=$(pgrep lftp | head -n 1) echo "${pid}" -if [ ${isRunning} -eq 0 ]; then +if [ ${#pid} -eq 0 ]; then echo "Starting lftp" sudo mkdir ${targetDir} 2>/dev/null sudo lftp -c "torrent -O ${targetDir} /home/admin/assets/${torrent}.torrent; bye"