Skip to content

Instantly share code, notes, and snippets.

@sengupta
Created March 9, 2012 14:50
Show Gist options
  • Save sengupta/2006827 to your computer and use it in GitHub Desktop.
Save sengupta/2006827 to your computer and use it in GitHub Desktop.
Reliance Netconnect Plus Prepaid Balance Checker

Reliance Netconnect Plus Prepaid Balance Checker

This is a small shell script that checks your Reliance Netconnect Prepaid account balance and emails it to a designated email address.

The Netconnect number and email address are to be saved in a file called .netconnectrc in your home directory with the following variables:

netconnect_number="1234567890"
email_addresses="comma separated list of email addresses"

I suggest setting this up as a cron-job. The necessary crontab entry is:

00 18 * * * /path/to/netconnect.sh

(This assumes you want the email to be sent at 6pm daily)

You may want to replace the mutt command by the appropriate mail command if you prefer using Mailx directly.

You can edit the crontab entry using the crontab -e command.

#!/bin/bash
source ~/.netconnectrc
curl -s http://www.rcom.co.in/rcom/Netconnect/Netconnect_Authentication.jsp?MDN=$netconnect_number \
| grep "Your Core" \
| sed 's/<[^>]*>//g' \
| sed -e 's/^[ \t]*//' \
| mutt -s "Your Netconnect Usage" $email_addresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment