Skip to content

Instantly share code, notes, and snippets.

@tamanobi
Last active January 31, 2024 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamanobi/716562b0aa84594eb8a1f1cdd0bae4df to your computer and use it in GitHub Desktop.
Save tamanobi/716562b0aa84594eb8a1f1cdd0bae4df to your computer and use it in GitHub Desktop.
他人にファイルを渡すときにめちゃくちゃ便利なやつ
#!/bin/bash
set -e
FILEPATH=$1
FILENAME=${FILEPATH##*/}
UUID=$2
# UUIDが未指定の場合、uuidgenで生成
if [ -z "$UUID" ]; then
UUID=$(uuidgen)
fi
set -u
PPNG_URL="https://ppng.io/${UUID}/${FILENAME}"
echo $PPNG_URL
exec curl -T "$FILEPATH" $PPNG_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment