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 429B

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