From 69b1e74409bcb227559162f3f0fdcc46a84adb44 Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Sun, 1 Apr 2012 23:57:39 +0100 Subject: Add a shell script to manage reboot. --- start.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 start.sh diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..830eece --- /dev/null +++ b/start.sh @@ -0,0 +1,18 @@ +#!/bin/bash +MM_ACTIVE=1 + +while [ $MM_ACTIVE != 0 ] +do + echo "Starting tradey...." + python2.7 main.py >> error_log.txt + + if [ "$?" != "0" ]; then + # Inventory/Money out of sync + echo "tradey quit with error at:" + date + MM_ACTIVE=0 + else + echo "Tradey quit normally, sleeping 60 seconds before a restart" + sleep 60 + fi +done -- cgit v1.2.3-70-g09d2