2 # Depends: pup, jq, curl
9 login_url
=https
://ugyfel.arubacloud.hu
/Login.aspx
10 login_response
=`curl -iSs "$login_url"`
11 login_header
=`echo "$login_response" | sed -e 's/\r//; /^\r\?$/q'`
12 login_page
=`echo "$login_response" | sed -e '1,/^\r\?$/d'`
14 cookies
=`echo "$login_header" | grep -Eo '^Set-Cookie:[^;]+' | cut -f2- -d: | tr "\n" ";"`
18 for field
in `echo "$login_page" | pup "form#form1 input[type=hidden] json{}" | jq -r '.[] | [.name, .value] | join(" ")'`
26 fields
["ctl00_ContentPlaceHolder1_ctl00_tooltipUsername_ClientState"]=''
27 fields
["ctl00\$ContentPlaceHolder1\$ctl00\$txtUserName"]=$Login
28 fields
["ctl00\$ContentPlaceHolder1\$ctl00\$txtPassword"]=$Password
29 fields
["ctl00\$ContentPlaceHolder1\$ctl00\$btnLogIn"]="Bejelentkezés"
33 for name
in "${!fields[@]}"
35 value
=${fields[$name]}
36 value
=`echo -n "$value" | url_encode`
37 post_data
="$post_data${post_data:+&}$name=$value"
42 home_page
=`curl -sS -L "$login_url" -H "Cookie: $cookies" -d "$post_data"`
43 credit
=`echo "$home_page" | pup '#ContentPlaceHolder1_ctl00_ucCredit_lblAmount text{}'`