15 lines
400 B
Bash
Executable file
15 lines
400 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
HOST="ld"
|
|
INTERNAL_PUBLIC_DIR="~/../services/data/files/uploads"
|
|
|
|
f="${1}"
|
|
fname="$(basename "${f}")"
|
|
uuid="$(uuid -v 1)"
|
|
|
|
[ "${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}/${fname}"
|
|
|
|
echo "${f} uploaded to https://lyte.dev/uploads/${fname}"
|