#!/bin/sh -e

if [ "$#" -eq 0 ]; then
  URL=$(exec curl -F file=@- https://0x0.st)
else
  URL=$(exec curl -F file=@"$1" https://0x0.st)
fi

echo "${URL}"
echo "${URL}" | pbcopy
