Simple image host.
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.

mshot 394B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. OS=$(uname)
  3. if [ "$1" = "" ]; then
  4. echo "mshot <name>"
  5. fi
  6. sleep 0.1
  7. DIR=$(mktemp -d /tmp/mupload.XXXXXXXXXX)
  8. if [ "$OS" = "Darwin" ]; then
  9. screencapture "$DIR/pic.png"
  10. else
  11. scrot "$DIR/pic.png"
  12. fi
  13. mupload "$DIR/pic.png" "img/${1}.png"
  14. if [ $? -eq 0 ]; then
  15. msound camera-shutter
  16. else
  17. merror "mshot" "Couldn't upload image file."
  18. echo "An error occurred." 1>&2
  19. exit 1
  20. fi