summaryrefslogtreecommitdiffstats
path: root/anonbox
diff options
context:
space:
mode:
authortv <tv@also>2011-01-11 18:49:41 +0100
committertv <tv@also>2011-07-24 20:13:44 +0200
commit5b5b3937d8e9e3615bd535fc9d436ade2fda0de4 (patch)
tree7beeed73f2e54f3a0d6245dfe130d5d13aad511f /anonbox
parentbcd60c0f6d582b708ca77d01c8c7074d61d3b97e (diff)
anonbox: add --check
Diffstat (limited to 'anonbox')
-rwxr-xr-xanonbox/anonbox.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/anonbox/anonbox.sh b/anonbox/anonbox.sh
index db35a5b4..d038cd0a 100755
--- a/anonbox/anonbox.sh
+++ b/anonbox/anonbox.sh
@@ -1,5 +1,6 @@
#! /bin/bash
-#### anonbox.net - anonbox account creator
+#### anonbox.net [--check]
+#### anonbox account creator
set -euf
##
@@ -16,7 +17,7 @@ eval "$(${GET-GET} |
s^<dd><p>([[:alnum:]@.]+)</p></dd>$\
email="\1" ; p
s^<dd><p><a href="([^"\\]+)">.*</a></p></dd>$\
- uri="\1" ; p
+ uri="\1/" ; p
s^<dd><p>([0-9]+)/([0-9]+)/([0-9]+) ([0-9]+):([0-9]+) ([ap]).m.</p></dd>$\
Y=20\3 ; \
m=\1 ; \
@@ -39,7 +40,18 @@ script_end_date="`date --rfc-3339=ns`"
##
for key in email uri best_before script_begin_date script_end_date ; do
eval "val=\"\$$key\""
- echo "$key $val"
+ echo "$key=\"$val\""
done
+##
+if echo "$*" | tr "$IFS" ' ' | egrep -q "(^| )--check( |$)"; then
+ file="/tmp/save-$email"
+ echo "file=\"$file\""
+ echo >&2
+ echo "# downloading email..." >&2
+ while ! curl -ksS "$uri" | tee "$file" | grep .; do
+ sleep 10
+ done
+fi
+
#### end of file.