From bcbb096d7d9feba52527e141b4a728a6d1a7c8ab Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 4 Oct 2007 16:21:34 -0600 Subject: [PATCH 1/2] Make health script suck less --- health.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/health.sh b/health.sh index dccf8a8..4337c22 100755 --- a/health.sh +++ b/health.sh @@ -2,6 +2,6 @@ ## Restart the bot if it's not running # Gallium assumes everything's in the cwd -cd /home/neale/src/firebot +cd $(basename $0) -kill -0 `cat gallium.pid` 2>/dev/null || ./gallium.py +kill -0 $(cat gallium.pid) 2>/dev/null || ./gallium.py From 2dcc5124bb4d4ef87aa89be7311153a8b0dacc70 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 4 Oct 2007 17:02:48 -0600 Subject: [PATCH 2/2] Even better health script (ie. works) --- health.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/health.sh b/health.sh index 4337c22..9dcaccf 100755 --- a/health.sh +++ b/health.sh @@ -1,7 +1,10 @@ #! /bin/sh ## Restart the bot if it's not running -# Gallium assumes everything's in the cwd -cd $(basename $0) +# You can specify which bot to run as a command line option; +# default gallium +bot=${1:-gallium} -kill -0 $(cat gallium.pid) 2>/dev/null || ./gallium.py +cd $(dirname $0) + +kill -0 $(cat $bot.pid) 2>/dev/null || ./$bot.py