PDA

View Full Version : standby - no depends on operations



nitr8
02-05-2007, 03:45 PM
Folks, haven't tested but this is what i came up with due to not relying on the operations file:

/var/tuxbox/config/standby.conf

# Stand By Wake Up Volume
STDBY_VOL=101
# EMU
STDBY_SHUTDOWN_EMU=0
# EPG
STDBY_SHUTDOWN_EPG=0

/var/tuxbox/config/standby.on

STDBY_CONF="/var/tuxbox/config/standby.conf"

# Standby Config *******************************************
if [ ! -e $STDBY_CONF ]; then
echo "Standby config Not Found..."
exit 1
fi

# Standby Volume *******************************************
STDBY_VOL=$(grep ^STDBY_VOL=.* $STDBY_CONF | cut -d '=' -f 2)
if [ $STDBY_VOL -lt 0 ] || [ $STDBY_VOL -gt 101 ]; then
echo "Invalid Volume"
exit 1
elif [ $STDBY_VOL -ne 101 ]; then
wget -O /dev/null http://localhost/control/volume?$STDBY_VOL
fi

# Terminate sectionsd ************************************
if grep -q "^STDBY_SHUTDOWN_EPG=1" $STDBY_CONF; then
echo "Stopping EPG..."
pidof sectionsd >/dev/null || sectionsd
killall -q sectionsd
if [ -e /tmp/sectionsd.sock ]; then
rm /tmp/sectionsd.sock
fi
fi

# Terminate EMU ******************************************
if grep -q "^STDBY_SHUTDOWN_EMU=1" $STDBY_CONF; then
echo "Terminate Default EMU..."
if [ -e /var/etc/.evocamd ] ; then
pidof evocamd >/dev/null || evocamd
killall -q evocamd
else
if [ -e /var/etc/.mgcamd ] ; then
pidof mgcamd >/dev/null || mgcamd
killall -q mgcamd
else
if [ -e /var/etc/.newcamd ] ; then
pidof newcamd >/dev/null || newcamd
killall -q newcamd
fi
fi
fi
fi

exit 0


/var/tuxbox/config/standby.off

STDBY_CONF="/var/tuxbox/config/standby.conf"

# Standby Config *******************************************
if [ ! -e $STDBY_CONF ]; then
echo "Standby config Not Found..."
exit 1
fi

# Start sectionsd ************************************
if grep -q "^STDBY_SHUTDOWN_EPG=1" $STDBY_CONF; then
echo "Starting EPG..."
sectionsd
fi

# Start Emu ******************************************
if grep -q "^STDBY_SHUTDOWN_EMU=1" $STDBY_CONF; then
echo "starte Default EMU..."
if [ -e /var/etc/.evocamd ] ; then
/var/bin/emu/evocamd > /dev/null 2>&1
else
if [ -e /var/etc/.mgcamd ] ; then
/var/bin/emu/mgcamd > /dev/null 2>&1
else
if [ -e /var/etc/.newcamd ] ; then
/var/bin/emu/newcamd > /dev/null 2>&1
fi
fi
fi

fi

exit 0

--me

nitr8
02-05-2007, 07:11 PM
works pukka :>

--me