don't confuse if [ ] expr if there is more than one running process

This commit is contained in:
Stefan Saraev 2012-03-05 19:23:18 +02:00
parent 00a8b0c17a
commit e5a918cef4
7 changed files with 8 additions and 8 deletions

View File

@ -64,7 +64,7 @@ else
TRANSMISSION_ARG="$TRANSMISSION_ARG -T" TRANSMISSION_ARG="$TRANSMISSION_ARG -T"
fi fi
if [ ! $(pidof transmission-daemon) ];then if [ ! "$(pidof transmission-daemon)" ];then
chmod +x $ADDON_DIR/lib/* chmod +x $ADDON_DIR/lib/*
LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" transmission-daemon $TRANSMISSION_ARG &>$LOG_FILE LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" transmission-daemon $TRANSMISSION_ARG &>$LOG_FILE

View File

@ -41,7 +41,7 @@ export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH"
cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1 cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1
if [ ! $(pidof boblightd) ]; then if [ ! "$(pidof boblightd)" ]; then
if [ -e $BOBLIGHT_CONFIG ]; then if [ -e $BOBLIGHT_CONFIG ]; then
# Make sure the xserver has started up # Make sure the xserver has started up
@ -53,7 +53,7 @@ if [ ! $(pidof boblightd) ]; then
fi fi
fi fi
if [ ! $(pidof boblight-X11) ]; then if [ ! "$(pidof boblight-X11)" ]; then
if [ -e $BOBLIGHT_X11 ]; then if [ -e $BOBLIGHT_X11 ]; then
# Make sure the xserver has started up # Make sure the xserver has started up

View File

@ -46,7 +46,7 @@ fi
TVHEADEND_ARG="-C -s -u root -g video -c $ADDON_HOME" TVHEADEND_ARG="-C -s -u root -g video -c $ADDON_HOME"
mkdir -p $ADDON_HOME mkdir -p $ADDON_HOME
if [ ! $(pidof $ADDON_BIN) ]; then if [ ! "$(pidof $ADDON_BIN)" ]; then
# start userspace DVB driver/addon # start userspace DVB driver/addon
for driver_dvb in $(find /storage/.xbmc/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do for driver_dvb in $(find /storage/.xbmc/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do
driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}') driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}')

View File

@ -27,7 +27,7 @@ LOCKFILE="tvheadend.disabled"
ADDON_BIN="tvheadend" ADDON_BIN="tvheadend"
if [ $(pidof $ADDON_BIN) ];then if [ "$(pidof $ADDON_BIN)" ];then
mkdir -p "$LOCKDIR" mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE" touch "$LOCKDIR/$LOCKFILE"
killall $ADDON_BIN killall $ADDON_BIN

View File

@ -28,7 +28,7 @@ REMOVE_MODULES=`grep REMOVE_MODULES $ADDON_SETTINGS | awk '{print $3 }' | sed -e
case "$1" in case "$1" in
hibernate|suspend) hibernate|suspend)
if [ $(pidof tvheadend) ];then if [ "$(pidof tvheadend)" ];then
progress "Shutting down HTS TVHeadend for suspending..." progress "Shutting down HTS TVHeadend for suspending..."
tvheadend.stop tvheadend.stop
for module in $REMOVE_MODULES ; do for module in $REMOVE_MODULES ; do

View File

@ -60,7 +60,7 @@ fi
done done
) )
if [ ! $(pidof vdr.bin) ];then if [ ! "$(pidof vdr.bin)" ];then
# start userspace DVB driver/addon # start userspace DVB driver/addon
for driver_dvb in $(find /storage/.xbmc/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do for driver_dvb in $(find /storage/.xbmc/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do
driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}') driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}')

View File

@ -25,7 +25,7 @@
LOCKDIR="/var/lock/" LOCKDIR="/var/lock/"
LOCKFILE="vdr.disabled" LOCKFILE="vdr.disabled"
if [ $(pidof vdr.bin) ];then if [ "$(pidof vdr.bin)" ];then
mkdir -p "$LOCKDIR" mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE" touch "$LOCKDIR/$LOCKFILE"
killall vdr.bin killall vdr.bin