[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: command-line report of account status



On 09/10/13 at 09:17am, Philipp Riegger wrote:
Hi,

I'm also interested in this.

On 09.10.2013 01:24, Colin Percival wrote:
On 10/08/13 16:12, ed wrote:
I would love to have a command-line app that outputs the same information that I
can get from the Tarsnap Account Management Interface on the webpage.  Perhaps a
default output of my current account balance with options to output Recent
Account Activity, Recent Activity for an Individual Machine, etc.

Have you tried wget? ;-)


This does what I need (adjust if you need more)…

#!/usr/bin/env bash
# Return tarsnap balance

read -p "Tarsnap username: " user
read -s -p "Tarsnap password: " pass

 wget --no-proxy --post-data="address=$user&password=$pass" --quiet \
    -O - 'https://www.tarsnap.com/manage.cgi' |\
    awk -F'[><]' '/balance/ {printf "\n%s\n", $3}'

Cheers,

/J

--

http://jasonwryan.com/  [GnuPG Key: B1BD4E40]


Attachment: pgpIeZLoF1o28.pgp
Description: PGP signature