summaryrefslogtreecommitdiff
path: root/sh/dyafk
diff options
context:
space:
mode:
Diffstat (limited to 'sh/dyafk')
-rwxr-xr-xsh/dyafk6
1 files changed, 5 insertions, 1 deletions
diff --git a/sh/dyafk b/sh/dyafk
index b6da7ec..782a2b8 100755
--- a/sh/dyafk
+++ b/sh/dyafk
@@ -10,7 +10,11 @@ while :; do
firefox --headless --profile "$HOME/.mozilla/firefox/dyafk" https://www.douyu.com/9640128 &
fi
else
- kill $(pidof firefox)
+ if pidof -q firefox; then
+ kill $(pidof firefox) 2>/dev/null
+ # for logging, so I know when firefox killed, which also need that `if pidof -q firefox`
+ echo 'kill firefox'
+ fi
fi
# open.douyu.com AUP for api request seems very high, about 6k/min per api? see https://open.douyu.com/source/api/5
# although I don't use open.douyu.com api but can be used as a reference, so I think 1 request per minute is ok