diff options
author | Lennart Poettering <lennart@poettering.net> | 2003-11-12 22:19:36 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2003-11-12 22:19:36 +0000 |
commit | dc6a404a45e8d270116d3c39ceeb2cc7c2c0d539 (patch) | |
tree | 8dc27f488d3a5ee22a6f79752f9b9dad9ef36a73 | |
parent | 50b012103fd006275a1ee11c58697f2623877f7b (diff) |
add client, fix size
git-svn-id: file:///home/lennart/svn/public/syrep-chub/trunk@8 4c8cc7d0-f3cb-0310-ad32-ddc431b48844
-rwxr-xr-x | list.cgi | 6 | ||||
-rwxr-xr-x | syrep-chub-client | 13 |
2 files changed, 16 insertions, 3 deletions
@@ -5,11 +5,11 @@ cgitb.enable() def bsize(s): if s > 1024*1024: - return "%lu MB" % s/1024/1024 + return "%i MB" % (s/1024/1024) elif s > 1024: - return "%lu KB" % s/1024 + return "%i KB" % (s/1024) else: - return "%lu B" % s + return "%i B" % s def list_files(): d = os.listdir(sch.repository_directory) diff --git a/syrep-chub-client b/syrep-chub-client new file mode 100755 index 0000000..0db57bb --- /dev/null +++ b/syrep-chub-client @@ -0,0 +1,13 @@ +#!/bin/sh + +SOURCE="$1" +if [ -z "$SOURCE" ] ; then + echo "You need to specify a file to upload" > /dev/stderr + exit 1 +fi + +URL="https://seth.intheinter.net/lennart/syrep-chub/upload.cgi" +DATE=$(date '+%Y%m%d%k%M%S') +FNAME="$HOSTNAME-$DATE" + +exec curl -f -s -k -T "$SOURCE" "$URL?$FNAME" > /dev/null |