have few times asked for feature which able to save Left/Right adio track for some channels in Audio menu, but havevent heard by DMM and IHaD teams
(that feature have other image more than year, but i dont like move to image cause one feature)
i have made script which does switching for defined channels (of corse without Save ability from Audio menu):
chmod 755 /var/script/SetAudio_Left-Right_userscript.sh
Bash
#!/bin/sh
#
foo="$0"
crntname=${foo##*/}
#LOGFILE=/tmp/"$crntname".log
WebIfFile=/tmp/"$crntname".WebIF
rm -f $WebIfFile
LOGSTR="`date +%y.%m.%d.\ %H:%M:%S` $crntname: -> "
crntpid=$$
echo $LOGSTR"STARTED - pid: $crntpid"
#echo $LOGSTR"STARTED - pid: $crntpid">"$LOGFILE"
#
# kill copyes of self
#
#pids=`pidof $crntname| sed -e s/$crntpid//`
#pids=`ps ax| grep $crntname| grep -v grep| grep -v $$| sed -e 's/ [a-z].*$//g'`
pids=`ps| grep $crntname| grep -v grep| grep -v $$| sed -e 's/ [a-z].*$//g'`
if [ -n "$pids" ];then
#echo $LOGSTR"pids to kill: $pids"
#echo $LOGSTR"pids to kill: $pids">>"$LOGFILE"
kill -9 $pids>/dev/null
fi
hex_to_dec () {
HexStrLen=`expr length $HexSTR`
HexStrPos=1
DEC=0
while [ "$HexStrLen" -ge "$HexStrPos" ]
do
DEC=$((DEC*16)) X0="0"
Hex1=`expr substr "$HexSTR" "$HexStrPos" 1`
case "$Hex1" in
[0-9]) X0="$Hex1";;
A|a) X0="10";;
B|b) X0="11";;
C|c) X0="12";;
D|d) X0="13";;
E|e) X0="14";;
F|f) X0="15";;
esac
DEC=$((DEC+X0*16))
HexStrPos=$((HexStrPos+1))
done
DEC=$((DEC/16))
}
ConfigPATH="/var/tuxbox/config/enigma/config"
if [ ! -f "$ConfigPATH" ]; then
ConfigPATH="/etc/enigma/config"
if [ ! -f "$ConfigPATH" ]; then PortDec="80"; fi
fi
if [ ! $PortDec ]; then
PortHex=`grep 'webifport=' "$ConfigPATH"| sed -e 's/.*webifport=//'`
if [ ! $PortHex ]; then
PortDec="80"
else
HexSTR="$PortHex"
hex_to_dec
PortDec="$DEC"
fi
fi
#
LastPmtMd5=""
LEFT="0" RIGHT="2"
PSWFILE="/var/script/reload_emu_names.txt"
DOCMD="wget -O $WebIfFile -q http://root:"
DOCMD1="@localhost:$PortDec/cgi-bin"
#end
if [ ! -e "$PSWFILE" ];then
LOCALPW="dreambox"
echo "$LOCALPW">"$PSWFILE"
else
LOCALPW=`cat -u "$PSWFILE"| head -1`
fi
# start
while true
do
LOGSTR="`date +%y.%m.%d.\ %H:%M:%S` $crntname: -> "
if [ ! -f /tmp/pmt.tmp ]; then
PmtMd5="0"
else
PmtMd5=`md5sum /tmp/pmt.tmp| awk {'print $1'}`
fi
if [ "$PmtMd5" = "$LastPmtMd5" ]; then
sleep 1
else
LastPmtMd5="$PmtMd5" SetAudio="Z"
$DOCMD$LOCALPW$DOCMD1/status
ServiceReference=`grep "service reference:</td><td>" $WebIfFile| tail -1| sed -e 's/.*<\/td><td>//' -e 's/<\/td><\/tr>//'`
echo $LOGSTR"channel is changed $ServiceReference"
echo $ServiceReference>/tmp/"$crntname".LastChannel
case "$ServiceReference" in
# TV1000 East 5E: set russian
1:0:1:87a:4:56:320000:0:0:0:) SetAudio="$LEFT";;
# Travel 5E: set russian
1:0:1:11f:1:1:322f4f:0:0:0:) SetAudio="$RIGHT";;
# NGC 1W: set english
1:0:1:c9:2:46:fff60000:0:0:0:) SetAudio="$LEFT""&language=0x0191";;
esac
if [ ! "$SetAudio" = "Z" ]; then
$DOCMD$LOCALPW$DOCMD1/setAudio?channel=$SetAudio
echo $LOGSTR"change audio track: channel=$SetAudio"
fi
fi
done
Alles anzeigen
litle ReadMe:
if password on dream isnt 'dreambox' then type it in file /var/script/reload_emu_names.txt