From: Jakub Czajka Date: Tue, 21 Nov 2023 23:31:48 +0000 (+0100) Subject: Wrap `list` to return HTTP responses. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=9e8b287ea863d4650a16126202d365b757af0676;p=gdrive_proxy.git Wrap `list` to return HTTP responses. --- diff --git a/gdrive_proxy.sh b/gdrive_proxy.sh new file mode 100755 index 0000000..031e6d3 --- /dev/null +++ b/gdrive_proxy.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# Copyright (c) 2023 Jakub Czajka +# License: GPL-3.0 or later. + +. /etc/environment + +# Kill authentication server if already present. +[ ! -z $(pgrep --full ".*gdrive_knife.*") ] && pkill --full ".*gdrive_knife.*" + +. ./auth.sh || exit 0 + +FILES=$(python3 -u -m gdrive_knife 2>&1 list --token ${gdrive_auth_token}) + +format_files() { + echo ${FILES} | xargs --replace={} --delimiter=" " echo "${1}" +} + +echo "HTTP/1.1 200 OK" +echo "Content-type: text/html" +echo " + + + + GdriveProxy + + + +
+

Upload

+
+ + + +
+ +
+ +

Download

+
+ + +
+ +
+ +

Delete

+
+ + +
+
+ +"