#!/bin/bash cookie_jar=cookies.tmp web_page=vonage.tmp username=USERNAME password=PASSWORD trap "rm -f $cookie_jar $web_page-*" EXIT curl --silent --cookie-jar $cookie_jar \ --output $web_page-1 \ http://www.vonage.com/?login curl --silent --cookie $cookie_jar --cookie-jar $cookie_jar \ --location \ --data "username=$username&password=$password" \ --output $web_page-2 \ https://secure.vonage.com/vonage-web/public/login.htm curl --silent --cookie $cookie_jar --cookie-jar $cookie_jar \ --output $web_page-3 \ https://secure.vonage.com/webaccount/billing/index.htm curl --silent --cookie $cookie_jar --cookie-jar $cookie_jar \ --location \ --output $web_page-4 \ https://secure.vonage.com/webaccount/public/logoff.htm echo echo echo Phone bill: $(grep 'td_value_total_amount' $web_page-3 | sed -e 's/.*>\$//' -e 's/<.*//')