From 187e288591b7bc43a1ef7adc23feee9834e036f2 Mon Sep 17 00:00:00 2001
From: Recolic Keghart <root@recolic.net>
Date: Wed, 25 Apr 2018 11:06:57 +0800
Subject: [PATCH] urgent bug fix

---
 daemon.sh               | 10 ++++------
 impl/daemon-answer.fish |  2 ++
 impl/daemon-signin.fish |  2 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/daemon.sh b/daemon.sh
index 59d8948..41efe08 100755
--- a/daemon.sh
+++ b/daemon.sh
@@ -6,10 +6,8 @@
 _openid=$(echo "$_openid" | sed 's/^.*openid=//g')
 echo "Set openid to $_openid"
 
-_url="https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=$_openid"
-
-_audio_player="mpg123"
-#_audio_player="cvlc --play-and-exit"
+#_audio_player="mpg123"
+_audio_player="cvlc --play-and-exit"
 
 function _segfault_detected () {
     echo "WARNING: segfault captured!"
@@ -29,12 +27,12 @@ fi
 cd impl
 
 if [[ $1 == sign ]]; then
-    _url="$_url" _audio_player="$_audio_player" ./daemon-signin.fish
+    _openid="$_openid" _audio_player="$_audio_player" ./daemon-signin.fish
     [[ $? == 127 ]] && exit 127
     _segfault_detected
 fi
 if [[ $1 == ans ]]; then
-    _url="$_url" _audio_player="$_audio_player" ./daemon-answer.fish
+    _openid="$_openid" _audio_player="$_audio_player" ./daemon-answer.fish
     [[ $? == 127 ]] && exit 127
     _segfault_detected
 fi
diff --git a/impl/daemon-answer.fish b/impl/daemon-answer.fish
index 66d305f..2925801 100755
--- a/impl/daemon-answer.fish
+++ b/impl/daemon-answer.fish
@@ -1,6 +1,8 @@
 #!/usr/bin/fish
 #Usage: fill _openid with openid from url of the page "学生->答题".
 
+_url="https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=$_openid"
+
 function _check_and_warn
     if _all_answered
         echo "LOG> exit because all question answered."
diff --git a/impl/daemon-signin.fish b/impl/daemon-signin.fish
index dc5f1b4..45eca31 100755
--- a/impl/daemon-signin.fish
+++ b/impl/daemon-signin.fish
@@ -1,5 +1,7 @@
 #!/usr/bin/fish
 
+_url="https://www.teachermate.com.cn/wechat/wechat/guide/signin?openid=$_openid"
+
 set tmpfl (mktemp)
 rm $tmpfl
 
-- 
GitLab