diff --git a/daemon-signin.fish b/daemon-signin.fish index d047d654978ea73df7dd315d94f9ee5ee792cbb9..40e83854256129091fbf5105341f05e1c7e42e43 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