dotfiles/scripts/bin/unshare/unshare

26 lines
488 B
Bash
Executable file

#!/usr/bin/env bash
# shellcheck shell=bash
# shellcheck source=../../lib/common.sh
source "${0%/*}/../share/dotfiles/lib/common.sh" || exit 1
delete-paste() {
if _has socat; then
local cmd=(socat -t 5 - tcp:unsha.re:10000)
printf '%s\n' "$1" | "${cmd[@]}"
else
echo 'Please make sure you have socat in your path.' >&2
return 1
fi
}
if [[ -n $1 ]]; then
token="$1"
else
read -r token
fi
delete-paste "$token"
# vi: set ft=sh ts=4 sw=4 sts=0 sr noet si tw=0 fdm=manual: