Simple image host.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

mshot 394B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. OS=$(uname)
  3. if [ "$1" = "" ]; then
  4. echo "mshot <name>"
  5. fi
  6. sleep 0.2
  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