A collection of useful scripts that I use on my desktop machines.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
294 B

  1. #!/bin/sh
  2. local_file=$1
  3. slug=$2
  4. token=$(cat "$HOME/.ily_token")
  5. if test -z "$slug"; then
  6. method=POST
  7. else
  8. method=PUT
  9. fi
  10. curl -X $method -H 'Accept: text/plain' \
  11. -H "Authorization: $token" \
  12. -F 'type=file' \
  13. -F "upload=@$local_file" \
  14. -F 'ttl=2592000' \
  15. "https://ily.li/$slug"