diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-01-07 09:29:51 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-01-07 09:29:51 +0100 |
commit | f215d3a620aae2f5759da83218fba57a104fbe0c (patch) | |
tree | a927a5dd41b53323867beae7ee4f2f9effe0da27 | |
parent | ba9d7d3b2cd9e04535bf8d78524b1afc003581c3 (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.
-rw-r--r-- | bash/bashrc | 24 | ||||
-rw-r--r-- | dotfiles/profile | 24 |
2 files changed, 24 insertions, 24 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) diff --git a/dotfiles/profile b/dotfiles/profile index 17b169e..3be0749 100644 --- a/dotfiles/profile +++ b/dotfiles/profile @@ -28,30 +28,6 @@ if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi -# 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}" -} - # TODO: umask? # source the machine-local configuration |