From f53377cc7dd1c8f0842c47c29a4929727bdbc825 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 4 Aug 2020 18:56:54 +0800 Subject: [PATCH] Update qbittorrent.tpl --- plugins/qbittorrent/init.d/qbittorrent.tpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/qbittorrent/init.d/qbittorrent.tpl b/plugins/qbittorrent/init.d/qbittorrent.tpl index a6fb06707..c17ae5d85 100755 --- a/plugins/qbittorrent/init.d/qbittorrent.tpl +++ b/plugins/qbittorrent/init.d/qbittorrent.tpl @@ -14,12 +14,24 @@ qb_start(){ + isStartFF=`ps -ef | grep 'ffmpeg' | grep -v grep |awk '{print $2}'` + if [ "$isStartFF" == '' ];then + echo "qbittorrent ffmpeg is running! can\`t start!!!" + return 1 + fi + cd {$SERVER_PATH}/qbittorrent/workers nohup python qbittorrent_worker.py > {$SERVER_PATH}/qbittorrent/logs.pl 2>&1 & echo "qbittorrent started" } qb_stop(){ + isStartFF=`ps -ef | grep 'ffmpeg' | grep -v grep |awk '{print $2}'` + if [ "$isStartFF" == '' ];then + echo "qbittorrent ffmpeg is running! can\`t stop!!!" + return 1 + fi + echo "Stopping ..." #ps -ef | grep qbittorrent-nox-bin | grep -v grep | awk '{print $2}' | xargs kill -9 ps -ef | grep "qbittorrent_worker.py" | grep -v grep | awk '{print $2}' | xargs kill -9