-
Notifications
You must be signed in to change notification settings - Fork 17
/
checkin.sh
28 lines (23 loc) · 821 Bytes
/
checkin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
domains=("www.url1.xxx" "www.url2.xxx")
# Username and password
username=("[email protected]" "[email protected]")
passwd=("password1" "password2")
function auto_checkin(){
curl -k -s -L -e '; auto' -d "email=$2&passwd=$3&code=" -c /tmp/checkin.cook "https://$1/auth/login" > /dev/null
retstr=$(curl -k -s -d "" -b /tmp/checkin.cook "https://$1/user/checkin")
[ -z "${retstr}" ] && return 1
echo ${retstr}
# echo $(echo "${retstr}" | awk -F '"' '{print $4}')
}
for i in $( seq 0 $(( ${#username[@]}-1 )) ); do
for d in ${domains[@]}; do
echo "Checking in for ${username[i]} with domain $d"
rm -rf /tmp/checkin.cook
if ( auto_checkin $d ${username[i]} ${passwd[i]} ); then
break
else
echo 'Checkin Failed!'
fi
done
done