summaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..ab368b0
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+APP="mandible"
+compile=0
+
+if [ "x$1" != "x" ]; then
+ compile=1
+fi
+
+if [ ! -x $APP ] || [ $compile == 1 ]; then
+ echo "Compiling $APP..."
+ echo
+ go build
+fi
+
+if pgrep $APP > /dev/null; then
+ echo "Killing running instance of $APP..."
+ echo
+ pkill $APP
+fi
+
+echo "Running $APP..."
+
+STATIC_DIR=$(pwd)/static \
+IMGUR_GO_CONF=$(pwd)/config/conf.json \
+UPLOAD_DIR=$(pwd)/files \
+UPLOAD_URL=http://i.iamfabulous.de:8080 \
+./$APP