scripts/dot-local/bin/up
2023-10-23 15:16:31 +11:00

23 lines
333 B
Bash
Executable file

#!/bin/zsh
upload() {
http --check-status --ignore-stdin --form \
POST https://up.00dani.me/ \
Authorization:$UP_TOKEN \
file@$1
}
if (( $# == 0 )); then
upload =(cat)
exit $?
fi
for f; do
if [[ ! -r $f ]]; then
print "up: $f is not a readable file" >&2
exit 1
fi
upload $f || exit $?
print
done