Просмотр исходного кода

Network errors are now handled, new error sound effect.

master
mort 9 лет назад
Родитель
Сommit
48a39b0153
5 измененных файлов: 26 добавлений и 7 удалений
  1. Двоичные данные
      assets/sounds/error.mp3
  2. 8
    1
      bin/mrec
  3. 7
    1
      bin/mshot
  4. 9
    2
      bin/mupload
  5. 2
    3
      bin/pbin

Двоичные данные
assets/sounds/error.mp3 Просмотреть файл


+ 8
- 1
bin/mrec Просмотреть файл

@@ -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
- 1
bin/mshot Просмотреть файл

@@ -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

+ 9
- 2
bin/mupload Просмотреть файл

@@ -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

+ 2
- 3
bin/pbin Просмотреть файл

@@ -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

Загрузка…
Отмена
Сохранить