From f215d3a620aae2f5759da83218fba57a104fbe0c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 7 Jan 2021 09:29:51 +0100 Subject: profile: move uploader functions to bashrc Functions from profile are not inherited by bash, so it makes no sense to put them in profile. --- bash/bashrc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'bash') 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) -- cgit v1.2.3