summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-12 15:26:18 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-12 15:26:18 +0100
commit6f4245eb390970a0ef4aba79fbc84e173239874d (patch)
treebe6d14c022e7f8fb61aad7bf51700f601c33d5ac /bin
parentf215d3a620aae2f5759da83218fba57a104fbe0c (diff)
bash: split up(s) into their own executables
Makes them easier to call from scripts.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/up10
-rwxr-xr-xbin/ups11
2 files changed, 21 insertions, 0 deletions
diff --git a/bin/up b/bin/up
new file mode 100755
index 0000000..52d9548
--- /dev/null
+++ b/bin/up
@@ -0,0 +1,10 @@
+#!/bin/bash
+# up.khirnov.net 0x0 instance
+if [ "$1" ]; then
+ fname=$(basename "$1")
+else
+ fname="-"
+fi
+
+url=$(curl -sS -E ~/.local/var/up/cert -F "file=@${fname}" "https://up.khirnov.net/")
+[ "${url}" ] && echo "${url}"
diff --git a/bin/ups b/bin/ups
new file mode 100755
index 0000000..8353f44
--- /dev/null
+++ b/bin/ups
@@ -0,0 +1,11 @@
+#!/bin/bash
+# ups.khirnov.net uploader
+
+if [ "$1" ]; then
+ fname=$(basename "$1")
+else
+ fname="-"
+fi
+
+url=$(curl -sS -E ~/.local/var/up/cert --data-binary "@${fname}" "https://ups.khirnov.net/${fname}")
+[ "${url}" ] && echo "${url}"