From ed78b5e3c74ee95bedd2fc6582c46149c8cb94df Mon Sep 17 00:00:00 2001 From: Adam Boeglin Date: Sat, 28 Jan 2012 19:23:31 -0500 Subject: [PATCH] Fixed so that the instance won't start if it's already running. --- .../boblightd/source/bin/boblightd.service | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service b/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service index c118773fe2..d789a536a0 100755 --- a/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service +++ b/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service @@ -37,24 +37,30 @@ BOBLIGHT_CONFIG="$ADDON_HOME/boblight.conf" # Flag file to start boblight-x11 daemon BOBLIGHT_X11="$ADDON_HOME/boblight.X11" +export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" + cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1 -if [ -e $BOBLIGHT_CONFIG ]; then - - # Make sure the xserver has started up - wait_for_xorg +if [ ! $(pidof boblightd) ]; then + if [ -e $BOBLIGHT_CONFIG ]; then - # Start the boblight daemon - boblightd -c $BOBLIGHT_CONFIG -f >> $LOG_FILE 2>&1 - + # Make sure the xserver has started up + wait_for_xorg + + # Start the boblight daemon + boblightd -c $BOBLIGHT_CONFIG -f >> $LOG_FILE 2>&1 + + fi fi -if [ -e $BOBLIGHT_X11 ]; then - - # Make sure the xserver has started up - wait_for_xorg - - # Start the boblight daemon - boblight-X11 -f >> $LOG_FILE 2>&1 - +if [ ! $(pidof boblight-X11) ]; then + if [ -e $BOBLIGHT_X11 ]; then + + # Make sure the xserver has started up + wait_for_xorg + + # Start the boblight daemon + boblight-X11 -f >> $LOG_FILE 2>&1 + + fi fi