From 9029a1eabcc69457e6dce3cd1712cd8acf761b29 Mon Sep 17 00:00:00 2001 From: Recolic Keghart <root@recolic.net> Date: Wed, 21 Mar 2018 19:56:17 +0800 Subject: [PATCH] update siginin.sh --- daemon-signin.fish | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/daemon-signin.fish b/daemon-signin.fish index d047d65..40e8385 100755 --- a/daemon-signin.fish +++ b/daemon-signin.fish @@ -13,22 +13,23 @@ set _audio_player "mpg123" set tmpfl (mktemp) -function reconfirm - curl "$_url" 2>/dev/null | grep "<p class='success-tip'>æš‚æ— ç¾åˆ°å¼€å¯</p>" - and mpg123 signin.mp3 -end - while true + sleep 5 date - curl "$_url" 2>/dev/null > $tmpfl + curl -L "$_url" 2>/dev/null > $tmpfl if grep '{"data":\[\],"msg":"unauthorized"}' $tmpfl mpg123 badid.mp3 - sleep 5 continue end - if not grep "<p class='success-tip'>æš‚æ— ç¾åˆ°å¼€å¯</p>" $tmpfl - reconfirm - #mpg123 signin.mp3 + if grep 'ç¾åˆ°ä¸...' $tmpfl + echo 'got' + mpg123 signin.mp3 + continue + end + if grep "<p class='success-tip'>æš‚æ— ç¾åˆ°å¼€å¯</p>" $tmpfl + continue + end + if grep 'ä½ å·²ç¾è¿‡åˆ°äº†' $tmpfl + continue end - sleep 5 end -- GitLab