#!/bin/bash OS=$(uname) if [ "$1" = "" ]; then echo "mshot " fi sleep 0.2 DIR=$(mktemp -d /tmp/mupload.XXXXXXXXXX) if [ "$OS" = "Darwin" ]; then screencapture "$DIR/pic.png" else scrot "$DIR/pic.png" fi mupload "$DIR/pic.png" "img/${1}.png" if [ $? -eq 0 ]; then msound camera-shutter else merror "mshot" "Couldn't upload image file." echo "An error occurred." 1>&2 exit 1 fi