Merge pull request #276 from stefansaraev/pidof

don't confuse if [ ] expr if there is more than one running process
This commit is contained in:
Stephan Raue 2012-03-05 10:09:45 -08:00
commit 639d5d3942
7 changed files with 8 additions and 8 deletions

View File

@ -64,7 +64,7 @@ else
TRANSMISSION_ARG="$TRANSMISSION_ARG -T"
fi
if [ ! $(pidof transmission-daemon) ];then
if [ ! "$(pidof transmission-daemon)" ];then
chmod +x $ADDON_DIR/lib/*
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
if [ ! $(pidof boblightd) ]; then
if [ ! "$(pidof boblightd)" ]; then
if [ -e $BOBLIGHT_CONFIG ]; then
# Make sure the xserver has started up
@ -53,7 +53,7 @@ if [ ! $(pidof boblightd) ]; then
fi
fi
if [ ! $(pidof boblight-X11) ]; then
if [ ! "$(pidof boblight-X11)" ]; then
if [ -e $BOBLIGHT_X11 ]; then
# 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"
mkdir -p $ADDON_HOME
if [ ! $(pidof $ADDON_BIN) ]; then
if [ ! "$(pidof $ADDON_BIN)" ]; then
# 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
driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}')

View File

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

View File

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

View File

@ -60,7 +60,7 @@ fi
done
)
if [ ! $(pidof vdr.bin) ];then
if [ ! "$(pidof vdr.bin)" ];then
# 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
driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}')

View File

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