summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlist.cgi6
-rwxr-xr-xsyrep-chub-client13
2 files changed, 16 insertions, 3 deletions
diff --git a/list.cgi b/list.cgi
index 73f981b..48b9c65 100755
--- a/list.cgi
+++ b/list.cgi
@@ -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