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

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



On 2013-10-09 00:23, Jason Ryan wrote:
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
Thanks, Jason! I can work with that for now. It'll be even sweeter when Colin gets secondary/read-only logins set up so that I can put those into a script without worrying about the security implications.

-Ed


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.