From 07231d95d29670458200d05b9a48a840ac688bc3 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 15 Feb 2012 13:10:58 +0000 Subject: rapid-tunneling: fix example rt_handle_uploaded_key git-svn-id: svn+ssh://xorcom/home/svn/debs/components/rapid-tunneling@10396 283159da-0705-0410-b60c-f2062b4bb6ad --- rt_handle_uploaded_key | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/rt_handle_uploaded_key b/rt_handle_uploaded_key index 87b5151..1ead82d 100755 --- a/rt_handle_uploaded_key +++ b/rt_handle_uploaded_key @@ -26,12 +26,12 @@ # find $TARBALLS_DIR -ctime +3 -exec rm -f '{}' \; # # To list all current tarballs, run the command with no extra parameter. -# it will list current tarballs (with the name, and creation time). +# it will list name, tunnelport, upload time and link URL. set -e # Required: -TARGET_DIR=$HOME/ra-tarballs +TARGET_DIR="$HOME/ra-tarballs" # The URL under which tarballs are accessible (for printing it) BASE_URL="http://updates.xorcom.com/k" @@ -45,7 +45,11 @@ tar_name() { } tar_time() { - LANG=C tar tvzf ra-tarballs/3d32382e.tgz port | awk '{print $4,$5}' + LANG=C tar tvzf "$1" port | awk '{print $4,$5}' +} + +tar_port() { + tar xOzf "$1" tunnelport 2>/dev/null } put_tarball() { @@ -67,12 +71,13 @@ put_tarball() { list() { for tarball in $TARGET_DIR/*.tgz; do - tar xOzf $tarball port >/dev/null 2>&1 || continue + echo $tarball + port=`tar_port "$tarball"` name=`tar_name "$tarball"` base_name="${tarball##*/}" url="$BASE_URL/$base_name" time=`tar_time "$tarball"` - printf "$name\t$time $url\n" + printf "$name\t$port\t$time $url\n" done } -- cgit v1.2.3