diff --git a/daemon.sh b/daemon.sh index 59d8948d67a32a75eb63fd72098bc16a8b906c3b..41efe08917ea78f5bd481c168b29d8a947d3d4e2 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 66d305f9e37b96d9c373747d2a372603e91a8412..2925801e3804e403b7c46c8c2c40c737df0bfa23 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 dc5f1b4ba711b9a920711f9ce521b8785f02f9ff..45eca316a00cd758824c184ca34acaf9e1a57b8c 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