diff options
Diffstat (limited to 'rt_handle_uploaded_key')
-rwxr-xr-x | rt_handle_uploaded_key | 15 |
1 files 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 } |