From 6f4245eb390970a0ef4aba79fbc84e173239874d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 12 Jan 2021 15:26:18 +0100 Subject: bash: split up(s) into their own executables Makes them easier to call from scripts. --- bash/bashrc | 24 ------------------------ bin/up | 10 ++++++++++ bin/ups | 11 +++++++++++ install.conf.yaml | 3 +++ 4 files changed, 24 insertions(+), 24 deletions(-) create mode 100755 bin/up create mode 100755 bin/ups diff --git a/bash/bashrc b/bash/bashrc index 3c71d56..18364ac 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -53,30 +53,6 @@ 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/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}" diff --git a/install.conf.yaml b/install.conf.yaml index cb2cec3..869b6da 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -2,6 +2,7 @@ - ~/.cache/vim/bkp - ~/.cache/vim/swap - ~/.config/bash + - ~/.local/bin - ~/.local/var/bash - ~/.local/var/cron/daily - ~/.local/var/dotfiles @@ -12,6 +13,8 @@ - ~/.vim/pack/dotfiles/opt - link: + ~/.local/bin/up: bin/up + ~/.local/bin/ups: bin/ups ~/.config/bash/prompt: bash/prompt ~/.bashrc: bash/bashrc ~/.gdbinit: dotfiles/gdbinit -- cgit v1.2.3