Summary
A small bash script to copy files to a webserver and create a link to the file. It prints the link to stdout and copies it to the clipboard. The program works with macOS Automator (e.g. to create a context menu-entry).
copy2share.sh
#! /bin/bash
md5sum=$(md5 -q "$1")
filename=$(basename "$1")
ssh server "mkdir /path/to/fileserver/$md5sum"
scp "$1" server:/path/to/fileserver/$md5sum/"${filename// /}"
echo "https://fileserver.example.com/$md5sum/"${filename// /}"" | tee /dev/tty | tr -d '\n' | pbcopy
afplay /System/Library/Sounds/Glass.aiff