#!/bin/sh

# ~/.exetel contains:
#   username[1]=04<blah1>
#   password[1]=<foobar2>
#   username[2]=04<blah1>
#   password[2]=<foobar2>
#   accounts=2

. ~/.exetel

for account in $(seq $accounts) ; do
    username=${username[account]}
    password=${password[account]}
    echo -n Account: $username
    wget -q -O - https://www.exetel.com.au/login/redirect.php --post-data="login_name=$username&password=$password&doLogin=1&submit=Login" |   \
	grep usage_content | 
    sed -e 's/<div class="usage_content">//' -e 's/<\/div>//' -e 's/\/.*//'
done
