From 184f5c9b33de568f74ddc62e53bc815a4dc82af8 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 16 Nov 2018 14:42:06 +0530 Subject: [PATCH] Add mbin.sh --- mbin.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 mbin.sh diff --git a/mbin.sh b/mbin.sh new file mode 100755 index 0000000..1878308 --- /dev/null +++ b/mbin.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Set MKR_BIN if not set. Export it in your shell rc to use a self hosted +# instance. Include the trailing slash with custom urls. +MKR_BIN=${MKR_BIN:-https://bin.mkr.pw/} + +op=$(curl -s -d "@-" -H "Content-Type:text/plain" $MKR_BIN) +link=$(echo $op | cut -f2 -d'/') +echo ${MKR_BIN}${link} | tee /dev/tty | xclip -selection clipboard