this way is litle crazy, but cant see other way cause
my skils are limited and DMM ignores requests for fix that problem
chmod 755 /usr/script/remove_def_favorites.sh
Bash
#!/bin/sh
E2config="/etc/enigma2/settings"
foo="$0"
crntNamePath=${foo%.*}
crntNameExt=${foo##*/}
crntNameShort=${crntNameExt%.*}
fileCmd=/tmp/"$crntNameShort".CMD
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
LOGSTR="$crntNameShort: -> "
if [ ! -f "$fileCmd" ]; then
echo $DateSTR $LOGSTR"STARTED - pid: $$"
else
echo $DateSTR $LOGSTR"ABORTED - cant run twice"
exit
fi
#
# kill copyes of self
#
pids=`ps| grep $crntNameExt| grep -v grep| grep -v $$| sed -e 's/ [a-z].*$//g'`
if [ -n "$pids" ]; then
kill -9 $pids>/dev/null
fi
#
# check bouquets file
#
DefIsFound=`grep 'userbouquet.favourites.tv' /etc/enigma2/bouquets.tv`
if [ ! "$DefIsFound" ]; then
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
echo $DateSTR $LOGSTR"ABORTED - cause Default bouquet not Found"
exit
fi
#
# check E2 configfile
#
if [ ! -f $E2config ]; then
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
echo $DateSTR $LOGSTR"ABORTED - !!! Enigma2 configfile not found !!!"
exit
fi
#
# check multibouquets is on
#
mbON=`grep multibouquet=true "$E2config"`
if [ ! $mbON ]; then
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
echo $DateSTR $LOGSTR"ABORTED - cause multibouquets isnt activated"
exit
fi
#
# Web-IF Port Nummber
#
WebIfCount=`grep 'Webinterface.interfacecount=' "$E2config"| sed -e 's/.*interfacecount=//'`
if [ ! $WebIfCount ]; then
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
echo $DateSTR $LOGSTR"WebIf isnt defined, add parameters to E2 config"
echo "config.plugins.Webinterface.interfacecount=2">>"$E2config"
echo "config.plugins.Webinterface.interfaces.0.useauth=true">>"$E2config"
echo "config.plugins.Webinterface.interfaces.1.port=81">>"$E2config"
echo "config.plugins.Webinterface.interfaces.1.useauth=false">>"$E2config"
echo "config.plugins.Webinterface.interfaces.1.address=127.0.0.1">>"$E2config"
echo "config.plugins.Webinterface.includemedia=true">>"$E2config"
echo "config.plugins.Webinterface.autowritetimer=true">>"$E2config"
killall -9 enigma2
WebIfCount=2
sleep 30
fi
FreePort="0"
IfNr="0"
while [ "$FreePort" = "0" ]
do
PortDec=`grep 'Webinterface.interfaces.'$IfNr'.port=' "$E2config"| sed -e 's/.*port=//'`
UseAuth=`grep 'Webinterface.interfaces.'$IfNr'.useauth=' "$E2config"| sed -e 's/.*useauth=//'`
Address=`grep 'Webinterface.interfaces.'$IfNr'.address=' "$E2config"| sed -e 's/.*address=//'`
if [ ! $PortDec ]; then PortDec="80"; fi
if [ ! "$UseAuth" -o "$UseAuth" = "false" ] && [ ! "$Address" -o "$Address" = "127.0.0.1" ]; then
FreePort="$PortDec"
elif [ "$WebIfCount" = $((IfNr+1)) ]; then
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
echo $DateSTR $LOGSTR"create new WebIf port for localhost without autentification"
sed -e s/^config.plugins.Webinterface.interfacecount="$WebIfCount/config.plugins.Webinterface.interfacecount="$((WebIfCount+1))/ "$E2config">"$E2config".tmp
echo "config.plugins.Webinterface.interfaces."$((IfNr+1))".port="$((PortDec+1))>>"$E2config".tmp
echo "config.plugins.Webinterface.interfaces."$((IfNr+1))".useauth=false">>"$E2config".tmp
echo "config.plugins.Webinterface.interfaces."$((IfNr+1))".address=127.0.0.1">>"$E2config".tmp
mv "$E2config".tmp "$E2config"
killall -9 enigma2
FreePort=$((PortDec+1))
sleep 30
#exit
fi
IfNr=$((IfNr+1))
done
DOCMD1="wget -O $fileCmd -q http://localhost:$FreePort/web"
DOCMD2=$DOCMD1/remotecontrol?command=
#
# Wait for service
#
ServiceInfo=0
while [ "$ServiceInfo" = "0" ]
do
sleep 2
DateSTR=`date +%y.%m.%d.\ %H:%M:%S`
echo $DateSTR>>"$fileCmd".tmp
$DOCMD1/subservices
if [ "$?" = "0" ]; then
ServiceInfo=1
fi
done
sleep 2
#
# TV
#
for RcCode in 174 174 174 174 174 174 402 377 401 106 106 106 106 106 139 108 352 ; do
$DOCMD2$RcCode
done
#
# Radio
#
RadioModeON=`grep e1like_radio_mode=true "$E2config"`
if [ ! $RadioModeON ]; then
for RcCode in 174 174 ; do
$DOCMD2$RcCode
done
else
for RcCode in 385 401 106 106 106 106 106 139 108 352 377 174 174 ; do
$DOCMD2$RcCode
done
fi
Alles anzeigen