This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/scripts/bin/pbin

16 lines
442 B
Plaintext
Raw Normal View History

2019-08-30 14:55:44 -05:00
#!/usr/bin/env bash
HOST="ld"
INTERNAL_PUBLIC_DIR="~/../services/data/files/pastes"
f="${1}"
2019-09-06 14:42:53 -05:00
uuid="$(uuid -v 1)"
2019-08-30 14:55:44 -05:00
[ "${f}" == "" ] && echo "No file provided. Exiting." >&2 && exit 2
[ ! -f "${f}" ] && echo "File '$f' does not exist. Exiting." >&2 && exit 1
scp "${f}" "${HOST}:${INTERNAL_PUBLIC_DIR}/${uuid}.txt"
echo "${f} uploaded to https://lyte.dev/pastes/${uuid}.txt"
echo "I recommend checking the file for secrets before sharing."