@@ -20,7 +20,14 @@ elif [ "$1" = "" ]; then #stop recording | |||
while [ -e "/proc/$pid" ]; do sleep 0.1; done | |||
mupload ~/.mrecfile.ogv "vid/${name}.ogv" | |||
msound ding.mp3 | |||
if [ $? -eq 0 ]; then | |||
msound ding.mp3 | |||
else | |||
msound error.mp3 | |||
echo "An error occurred." 1>&2 | |||
exit 1 | |||
fi | |||
else #start recording | |||
rm ~/.mrecfile.ogv &>/dev/null | |||
rm ~/.mrecname &>/dev/null |
@@ -7,6 +7,12 @@ fi | |||
sleep 0.1 | |||
DIR=`mktemp -d` | |||
scrot "$DIR/pic.png" | |||
msound camera-shutter.mp3 | |||
mupload "$DIR/pic.png" "img/${1}.png" | |||
if [ $? -eq 0 ]; then | |||
msound camera-shutter.mp3 | |||
else | |||
msound error.mp3 | |||
echo "An error occurred." 1>&2 | |||
exit 1 | |||
fi |
@@ -1,11 +1,18 @@ | |||
#!/bin/bash | |||
if [ ! -f "$1" ] || [ "$2" == "" ]; then | |||
if [ "$1" == "" ] || [ "$2" == "" ]; then | |||
echo "mupload <file> <name>" | |||
exit 1 | |||
elif [ ! -f "$1" ]; then | |||
echo "File $1 doesn't exist." | |||
exit 1 | |||
fi | |||
URL="http://d.mort.coffee/$2" | |||
echo $URL | xsel -ib | |||
scp "$1" "martin@serve.mort.coffee:/var/www/mort.coffee/d/public/$2" | |||
echo $URL | |||
if [ $? -eq 0 ]; then | |||
echo $URL | |||
else | |||
exit 1 | |||
fi |
@@ -13,9 +13,7 @@ if [ -t 0 ]; then | |||
fi | |||
if [ ! -t 0 ]; then | |||
echo "catting -" | |||
content=$(cat -) | |||
echo "- catted" | |||
name="$1" | |||
else | |||
content=$(cat $1) | |||
@@ -27,5 +25,6 @@ pasteId=$(curl "$url" -s -F "name=$name" -F "content=$content") | |||
if [ $? -eq 0 ]; then | |||
echo "Your paste should now be at http://pbin.in/$pasteId" | |||
else | |||
echo "There was an error. The file you provided may be too big." | |||
echo "An error occurred." 1>&2 | |||
exit 1 | |||
fi |