Anyone can help?
I try in telnet with command:
but it won't display it on screen!
When I type for example:
it work!
What is the difference and why I cannot send webif message through telnet?
</big></big>
Anyone can help?
I try in telnet with command:
but it won't display it on screen!
When I type for example:
it work!
What is the difference and why I cannot send webif message through telnet?
</big></big>
Ahh..
Thats it!!
Thank you very much!
I have one more question.
How, and can I start some python plugin through telnet?
Thx
short:
python /some/path/python.py (or *.pyo)
extended example:
root@Dream8k_M3:~# cat /usr/script/AccessPoint.sh
#!/bin/sh
#
#opkg install hostap-daemon hostap-utils madwifi-ng-tools kernel-module-bridge
#[ -e /usr/lib/enigma2/python/Plugins/newnigma2/AccessPoint.pyo ] && python /usr/lib/enigma2/python/Plugins/newnigma2/AccessPoint.pyo &
pyFile=/usr/script/AccessPoint.pyo
[ -e "$pyFile" ] && [ `ps aux| grep -v grep| grep -c "/hostapd "` = 0 ] && python "$pyFile"
root@Dream8k_M3:~#
Alles anzeigen
Thx for helping me..
I try somthing like you suggest this before in simplest way as:
Navigate to plugin directory.. then call python and insade pyton prompt type name of the plugin.
But result is same as your script, it complain about modules that can not import.
I mentioning that plugin is OK if I start it with remote control.
What I want, is to simulate with some command same as I start it with remote control, but from telnet window.
Here is the error from your script:
root@dm800se:/# pyFile=/usr/lib/enigma2/python/Plugins/Extensions/EasyBouquetDownloader/plugin.pyo
root@dm800se:/# [ -e "$pyFile" ] && [ `ps aux| grep -v grep| grep -c "/hostapd "` = 0 ] && python "$pyFile"
Traceback (most recent call last):
File "/usr/lib/enigma2/python/Plugins/Extensions/EasyBouquetDownloader/plugin.py", line 1, in <module>
from Screens.Screen import Screen
ImportError: No module named Screens.Screen
root@dm800se:/#
Plugin is very simple.
It contain 4 row and every row execute some script.
haven't that opinion how to display something in GUI from self made *.py,
*.sh scripts i start from Menu->Plugins->ScriptExecuter, there output will be same as in console
by **/EasyBouquetDownloader/** i can guess you are searching solution how to update bouquet files,
i will show my way:
on my master box(dm8000) time at time i run manually
/usr/script/ServicesE2_backup_userscript.sh
it creates servicesE2_bc.tar.gz(services+bouquets) and servicesE2_bc.tar.gz_md5.txt(archive's md5)
that files i place under some www
and all slave boxes have
/usr/script/MartiniChannelsListE2_download_userscript.sh
it download&replace services&bouquets only if md5 control sum has been changed since last execute time
content of sh files(second without www path)
/usr/script/ServicesE2_backup_userscript.sh
#!/bin/sh
# MartiniB #
###################
foo="$0"
crntNameExt=${foo##*/}
crntNameShort=${crntNameExt%_userscr*}
#BoxNAME=`cat -u /var/etc/hostname| head -n1`
[ -e /var/etc/hostname_own ] && BoxNAME=`cat -u /var/etc/hostname_own| head -n1` || BoxNAME=`cat -u /var/etc/hostname| head -n1`
#BoxTYPE=`grep -s type= /proc/bus/dreambox| head -n1| sed -e 's/.*type=//'`
BoxTYPE=`cat -u /proc/stb/info/model| head -n1`
TAR_NAME="$crntNameShort"_`date +%Y.%m.%d`_"$BoxNAME"\("$BoxTYPE"\)
DirTmp="/tmp/"
DirEtc="/etc/"
DirTuxbox="/etc/tuxbox/"
DirEnigma="/etc/enigma2/"
CopyTo=""/media/hdd" "/media/net/bigdisk/zzzDreambox_tmp""
dos2unix "$DirEnigma"*bouquet*
add_to_tarline () {
if [ -e "$i" ]; then
files2tar="$files2tar"`echo "$i"| sed s?\/??`" "
echo "$i"
echo "$i">>"$LogFile"
else
echo "!!! NOT FOUND: $i"
echo "!!! NOT FOUND: $i">>"$LogFile"
fi
}
print_bt_2_log () {
echo ""
echo "">>"$LogFile"
echo "$BT:"
echo "$BT:">>"$LogFile"
}
files2tar=""
LogFile="$DirTmp$TAR_NAME"_log.txt
echo "$DirTmp$TAR_NAME">"$LogFile"
echo "">>"$LogFile"
rm -rf "$DirTmp$TAR_NAME"*
BT="SERVICES"
print_bt_2_log
for i in "$DirEnigma"lamedb "$DirEnigma"*bouquet* "$DirEnigma"blacklist "$DirEnigma"whitelist "$DirTuxbox"satellites.xml; do
add_to_tarline
done
if [ ! "$files2tar" = "" ]; then
BT="create "$DirTmp$TAR_NAME".tar.gz"
print_bt_2_log
tar -czf "$DirTmp$TAR_NAME".tar.gz -C / ${files2tar}
if [ -f "$DirTmp$TAR_NAME".tar.gz ]; then
md5sum "$DirTmp$TAR_NAME".tar.gz| awk {'print $1'}>"$DirTmp$TAR_NAME"_md5.txt
for cpPATH in $CopyTo; do
if [ -e "$cpPATH" ]; then
echo copy to "$cpPATH"
cp "$DirTmp$TAR_NAME".tar.gz "$cpPATH"/>/dev/null
#cp "$DirTmp$TAR_NAME"_md5.txt "$cpPATH"/>/dev/null
cp "$LogFile" "$cpPATH"/>/dev/null
cp "$DirTmp$TAR_NAME".tar.gz "$cpPATH"/servicesE2_bc.tar.gz>/dev/null
cp "$DirTmp$TAR_NAME"_md5.txt "$cpPATH"/servicesE2_bc.tar.gz_md5.txt>/dev/null
fi
done
else
echo "!!! FAILED !!!"
fi
fi
exit 0
Alles anzeigen
/usr/script/MartiniChannelsListE2_download_userscript.sh
#!/bin/sh
# MartiniB #
## configuration
URL="http://www.?????????/"
FILENAME="servicesE2_bc.tar.gz"
## end
foo="$0"
shTXT=${foo%.*}".txt"
DirEnigma=/etc/enigma2/
E2conf="$DirEnigma"settings
fLAMEDB="$DirEnigma"lamedb
fTMP="$fLAMEDB".tmp
rm -rf /tmp/$FILENAME /tmp/"$FILENAME"_md5.txt "$fTMP"
RemoveTerrestialBouquets () {
sed -e 's/.*"userbouquet\.lattelecom\.tv".*//' -e 's/.*"userbouquet\.baltcom\.tv".*//' "$DirEnigma"bouquets.tv| sed '/^$/d'>"$DirEnigma"bouquets.tv.tmp
[ -s "$DirEnigma"bouquets.tv.tmp ] && mv "$DirEnigma"bouquets.tv.tmp "$DirEnigma"bouquets.tv
rm -f "$DirEnigma"*lattelecom.tv "$DirEnigma"*baltcom.tv
#RebootBox=1
}
PatchTerrestialRegionalTransponders () {
case `cat "$fLAMEDB"_patch_dvbt` in
cesvaine)
sed -e 's/t\ 530000000:/t\ 634000000:/' -e 's/t\ 554000000:/t\ 770000000:/' -e 's/t\ 650000000:/t\ 482000000:/' -e 's/t\ 666000000:/t\ 858000000:/' -e 's/t\ 690000000:/t\ 546000000:/' -e 's/t\ 658000000:/t\ 498000000:/' "$fLAMEDB">"$fTMP";;
daugavpils)
sed -e 's/t\ 530000000:/t\ 682000000:/' -e 's/t\ 554000000:/t\ 714000000:/' -e 's/t\ 650000000:/t\ 818000000:/' -e 's/t\ 666000000:/t\ 522000000:/' -e 's/t\ 690000000:/t\ 618000000:/' -e 's/t\ 658000000:/t\ 626000000:/' "$fLAMEDB">"$fTMP";;
kuldiga)
sed -e 's/t\ 530000000:/t\ 546000000:/' -e 's/t\ 554000000:/t\ 626000000:/' -e 's/t\ 650000000:/t\ 682000000:/' -e 's/t\ 666000000:/t\ 722000000:/' -e 's/t\ 690000000:/t\ 506000000:/' -e 's/t\ 658000000:/t\ 586000000:/' "$fLAMEDB">"$fTMP";;
liepaja)
sed -e 's/t\ 530000000:/t\ 474000000:/' -e 's/t\ 554000000:/t\ 794000000:/' -e 's/t\ 650000000:/t\ 802000000:/' -e 's/t\ 666000000:/t\ 514000000:/' -e 's/t\ 690000000:/t\ 570000000:/' -e 's/t\ 658000000:/t\ 586000000:/' "$fLAMEDB">"$fTMP";;
rezekne)
sed -e 's/t\ 530000000:/t\ 658000000:/' -e 's/t\ 554000000:/t\ 706000000:/' -e 's/t\ 650000000:/t\ 802000000:/' -e 's/t\ 666000000:/t\ 522000000:/' -e 's/t\ 690000000:/t\ 618000000:/' -e 's/t\ 658000000:/t\ 602000000:/' "$fLAMEDB">"$fTMP";;
valmiera)
sed -e 's/t\ 530000000:/t\ 474000000:/' -e 's/t\ 554000000:/t\ 714000000:/' -e 's/t\ 650000000:/t\ 738000000:/' -e 's/t\ 666000000:/t\ 706000000:/' -e 's/t\ 690000000:/t\ 570000000:/' -e 's/t\ 658000000:/t\ 826000000:/' "$fLAMEDB">"$fTMP";;
viesite)
sed -e 's/t\ 530000000:/t\ 610000000:/' -e 's/t\ 554000000:/t\ 674000000:/' -e 's/t\ 650000000:/t\ 786000000:/' -e 's/t\ 666000000:/t\ 730000000:/' -e 's/t\ 690000000:/t\ 514000000:/' -e 's/t\ 658000000:/t\ 490000000:/' "$fLAMEDB">"$fTMP";;
esac
[ -s "$fTMP" ] && mv "$fTMP" "$fLAMEDB"
}
CleanBouquetsFromNotInstalledSattelites () {
FoundSatPosHEX="" SatPosToSED=""
for SatPosHEX in `grep "#SERVICE 1:0:.*:.*:.*:.*:.*:0:0:0:" "$DirEnigma"userbouquet.*| sed -e s/....:0:0:0://g -e s/.*://g| sort| uniq`; do
SatPosDEC=$((0x$SatPosHEX))
if [ "$SatPosDEC" -le 3600 ]; then
# echo sat
[ "$SatPosDEC" -gt 1800 ] && SatPosANA=$((((3600-SatPosDEC+2))/10))" West" || SatPosANA=$((((SatPosDEC+2))/10))" East"
if ! grep -qs ".sat.$SatPosDEC." "$E2conf"; then
echo "Sat pos "$SatPosANA" not installed - remove services from bouquet files"
[ ! "$SatPosToSED" ] && SatPosToSED="$SatPosHEX" || SatPosToSED="$SatPosToSED\\|$SatPosHEX"
else
echo "Sat pos "$SatPosANA" found - ok"
fi
#elif [ "$SatPosDEC" = 56797 ]; then
# echo cable
#elif [ "$SatPosDEC" = 61166 ]; then
# echo air
fi
done
if [ "$SatPosToSED" ]; then
for fBouquet in "$DirEnigma"userbouquet.*.tv "$DirEnigma"userbouquet.*.radio; do
sed s/^"#SERVICE\ 1:0:.*:.*:.*:.*:\("$SatPosToSED"\)"....:.*:.*:.*://g "$fBouquet"| uniq| sed '/^$/{N;s/\n\#DESCR.*//;}'| sed '/^$/d'>"$fBouquet".tmp
if [ -s "$fBouquet".tmp ] && [ `md5sum $fBouquet| awk {'print $1'}` != `md5sum "$fBouquet".tmp| awk {'print $1'}` ]; then
mv "$fBouquet".tmp "$fBouquet"
else
rm -f "$fBouquet".tmp
fi
done
fi
}
SleepAndReboot () {
while true
do
sleep 5; reboot; sleep 9; killall -9 enigma2
done
}
wget -q "$URL$FILENAME"_md5.txt -P /tmp
if [ "$?" = "0" ]; then
if [ -s /tmp/"$FILENAME"_md5.txt ]; then
CrntMD5=`cat -u /tmp/"$FILENAME"_md5.txt| head -n1`
[ -e "$shTXT" ] && PrevMD5=`cat -u "$shTXT"| head -n1` || PrevMD5="00"
if [ "$PrevMD5" = "$CrntMD5" ]; then
echo "file on server isn't changed"
else
wget $URL$FILENAME -P /tmp
if [ "$?" = "0" ]; then
if [ -s /tmp/$FILENAME ]; then
echo extract files
echo "$CrntMD5">"$shTXT"
rm -f "$DirEnigma"userbouquet.*
#init 4; sleep 4; killall -9 enigma2; sleep 2
tar -zxf /tmp/$FILENAME -C /
if [ `grep -ics "DVB-T" /proc/bus/nim_sockets` -eq 0 ]; then
RemoveTerrestialBouquets
elif [ `grep -ics "TrialTuner" /proc/bus/nim_sockets` -gt 0 ] || [ -e /lib/modules/*/extra/trialtunerdriver.ko ]; then
sed -e '/^[[:space:]]s\ .*:.*:.*:.*:.*:.*:.*:.*:/,/\// s/:[01]$/:2/' "$fLAMEDB">"$fTMP"
[ -s "$fTMP" ] && mv "$fTMP" "$fLAMEDB"
sed -r '/^[[:space:]]s\ .*:.*/,/\// s|(s ([^:]+:){5})([^:]+:){1}(.*)|\12:\4|' "$fLAMEDB">"$fTMP"
[ -s "$fTMP" ] && mv "$fTMP" "$fLAMEDB"
#RebootBox=1
fi
[ -e "$fLAMEDB"_patch_dvbt ] && PatchTerrestialRegionalTransponders
if grep -qs ".sat.3590." "$E2conf"|| grep -qs ".sat.49." "$E2conf"|| grep -qs ".sat.50." "$E2conf"|| grep -qs ".sat.158." "$E2conf"; then
echo change Sat positions in Enigma2 config
echo restart GUI && sleep 2
sed -e 's/\.sat\.3590\./\.sat\.3592\./' -e 's/\.sat\.49\./\.sat\.48\./' -e 's/\.sat\.50\./\.sat\.48\./' -e 's/\.sat\.158\./\.sat\.160\./' "$E2conf">"$E2conf".tmp
[ -s "$E2conf".tmp ] && mv "$E2conf".tmp "$E2conf"
#[ "$RebootBox" = "1" ] && reboot || init 3
#else
#echo reaload services and bouquets
#wget -O /dev/null -q http://127.0.0.1/web/servicelistreload?mode=0
#[ "$RebootBox" = "1" -o `grep -ics "DVB" /proc/bus/usb/devices` -gt 0 ] && reboot || init 3
fi
CleanBouquetsFromNotInstalledSattelites
if [ `ps aux| grep -v grep| grep -c enigma2` -gt 0 ]; then
echo restart box
SleepAndReboot &
killall -9 enigma2
fi
else
echo Zero len /tmp/$FILENAME
fi
else
echo !!! Download $URL$FILENAME failed !!!
fi
fi
else
echo Zero len /tmp/"$FILENAME"_md5.txt
fi
else
echo !!! Download "$URL$FILENAME"_md5.txt failed !!!
fi
exit 0
Alles anzeigen
Thx mate for scripts, but I made my own as E2 plugin and it work nice..
I was just interested how to use telnet not just exacly for this one plugin, but some other command.
The idea was to use telnet as remote control, and start manualy plugin as some script, but execute on dreambox with GUI.
Anyone else with some idea?