Skip to content

Instantly share code, notes, and snippets.

@pexcn
Created March 4, 2018 11:54
Show Gist options
  • Save pexcn/2b646ab944967c0f32fb2706aef30470 to your computer and use it in GitHub Desktop.
Save pexcn/2b646ab944967c0f32fb2706aef30470 to your computer and use it in GitHub Desktop.
china unicom mobile client auto sign script
#!/bin/bash -xe
# Replace ******** with your token
export SIGN_IN_URL=http://m.client.10010.com/SigninApp/signin/querySigninActivity.htm?token=********
export DAY_SIGN_URL=http://m.client.10010.com/SigninApp/signin/daySign.do
export SCRIPT_PATH=$(dirname $0)
echo "$(date +'%Y-%m-%d %T')" >> $SCRIPT_PATH/log.txt
curl $SIGN_IN_URL \
-H "Host: m.client.10010.com" \
-H "Origin: null" \
-H "Upgrade-Insecure-Requests: 1" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
-H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 unicom{version:[email protected]}" \
-H "Accept-Language: zh-cn" \
-H "Accept-Encoding: gzip, deflate" \
-H "Connection: keep-alive" \
--cookie-jar $SCRIPT_PATH/cookie.txt \
--silent --output /dev/null
curl $DAY_SIGN_URL \
-H "Host: m.client.10010.com" \
-H "Origin: null" \
-H "Upgrade-Insecure-Requests: 1" \
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
-H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 unicom{version:[email protected]}" \
-H "Accept-Language: zh-cn" \
-H "Accept-Encoding: gzip, deflate" \
-H "Connection: keep-alive" \
--cookie $SCRIPT_PATH/cookie.txt \
--silent >> $SCRIPT_PATH/log.txt
echo -e "\n" >> $SCRIPT_PATH/log.txt
if [ -f $SCRIPT_PATH/cookie.txt ]; then
rm $SCRIPT_PATH/cookie.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment