summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2012-04-01 23:57:39 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2012-04-01 23:57:39 +0100
commit69b1e74409bcb227559162f3f0fdcc46a84adb44 (patch)
tree49f0a71ced18971e6a6870e524c75164fa7b6e30
parentf74ec66b339cb81bf4bc6e3e59935137ae7b63ce (diff)
downloadmanamarket-69b1e74409bcb227559162f3f0fdcc46a84adb44.tar.gz
manamarket-69b1e74409bcb227559162f3f0fdcc46a84adb44.tar.bz2
manamarket-69b1e74409bcb227559162f3f0fdcc46a84adb44.tar.xz
manamarket-69b1e74409bcb227559162f3f0fdcc46a84adb44.zip
Add a shell script to manage reboot.
-rwxr-xr-xstart.sh18
1 files changed, 18 insertions, 0 deletions
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