summaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-07 09:29:51 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-07 09:29:51 +0100
commitf215d3a620aae2f5759da83218fba57a104fbe0c (patch)
treea927a5dd41b53323867beae7ee4f2f9effe0da27 /bash
parentba9d7d3b2cd9e04535bf8d78524b1afc003581c3 (diff)
profile: move uploader functions to bashrc
Functions from profile are not inherited by bash, so it makes no sense to put them in profile.
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc24
1 files changed, 24 insertions, 0 deletions
diff --git a/bash/bashrc b/bash/bashrc
index 18364ac..3c71d56 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -53,6 +53,30 @@ cu()
cd "${dir}"
}
+# ups.khirnov.net uploader
+ups() {
+ 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}"
+}
+
+# up.khirnov.net 0x0 instance
+up() {
+ 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}"
+}
+
# define the prompt
. ~/.config/bash/prompt
PS1=$(__prompt_func)