yweb: minor shell script changes for CS (ybug 444)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@451 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
yjogol
2010-03-05 05:37:09 +00:00
parent 848dd1897e
commit 7a608961ba
5 changed files with 62 additions and 115 deletions

View File

@@ -1,6 +1,6 @@
installdir = $(DATADIR)/neutrino/httpd/scripts
install_DATA= api.sh _Y_Globals.sh _Y_Library.sh Y_Live.sh Y_Plugins.sh Y_Tools.sh
install_DATA= api.sh _Y_Globals.sh _Y_Library.sh Y_Live.sh Y_Tools.sh
install-data-hook:
chmod 0755 $(DATADIR)/neutrino/httpd/scripts/api.sh

View File

@@ -11,14 +11,18 @@
# -----------------------------------------------------------
live_lock()
{
call_webserver "control/lcd?lock=1&clear=1&rect=10,10,110,50,1,0&xpos=20&ypos=27&size=22&font=2&text=%20%20%20%20yWeb%0A%20%20LiveView&update=1" >/dev/null
if [ "$boxtype" != "coolstream" ]; then
call_webserver "control/lcd?lock=1&clear=1&rect=10,10,110,50,1,0&xpos=20&ypos=27&size=22&font=2&text=%20%20%20%20yWeb%0A%20%20LiveView&update=1" >/dev/null
fi
call_webserver "control/rc?lock" >/dev/null
call_webserver "control/zapto?stopplayback" >/dev/null
}
# -----------------------------------------------------------
live_unlock()
{
call_webserver "control/lcd?lock=0" >/dev/null
if [ "$boxtype" != "coolstream" ]; then
call_webserver "control/lcd?lock=0" >/dev/null
fi
call_webserver "control/rc?unlock" >/dev/null
call_webserver "control/zapto?startplayback" >/dev/null
}
@@ -26,13 +30,17 @@ live_unlock()
prepare_tv()
{
# SPTS on
call_webserver "control/system?setAViAExtPlayBack=spts" >/dev/null
if [ "$boxtype" != "coolstream" ]; then
call_webserver "control/system?setAViAExtPlayBack=spts" >/dev/null
fi
}
# -----------------------------------------------------------
prepare_radio()
{
# SPTS off
call_webserver "control/system?setAViAExtPlayBack=pes" >/dev/null
if [ "$boxtype" != "coolstream" ]; then
call_webserver "control/system?setAViAExtPlayBack=pes" >/dev/null
fi
}
# -----------------------------------
@@ -108,7 +116,7 @@ case "$1" in
;;
*)
echo "Parameter falsch: $*" ;;
echo "Parameter wrong: $*" ;;
esac

View File

@@ -1,70 +0,0 @@
#!/bin/sh
# -----------------------------------------------------------
# Plugins (yjogol)
# $Date$
# $Revision$
# -----------------------------------------------------------
. ./_Y_Globals.sh
. ./_Y_Library.sh
# ===========================================================
# Settings : Skins
# ===========================================================
# -----------------------------------------------------------
# Skin Liste
# -----------------------------------------------------------
skin_get()
{
check_Y_Web_conf
active_skin=`config_get_value_direct $y_config_Y_Web 'skin'`
html_option_list=""
skin_list=`find $y_path_httpd -name 'Y_Main-*'`
for f in $skin_list
do
skin=`echo "$f"|sed -e s/^.*Y_Main-//g|sed -e s/.css//g`
if [ "$skin" = "$active_skin" ]
then
selec="selected"
else
selec=""
fi
opt="<option $selec value='$skin'>$skin</option>"
html_option_list="$html_option_list $opt"
done
echo "$html_option_list"
}
# -----------------------------------------------------------
# Skin setzen : css ueberschreiben $1=Skin-Name
# -----------------------------------------------------------
skin_set()
{
cd $y_path_httpd
cp Y_Main-$1.css Y_Main.css
if [ -e global-$1.css ]
then
cp global-$1.css global.css
else
cp global-Standard.css global.css
fi
config_set_value_direct $y_config_Y_Web 'skin' $1
msg="Skin changed - Now browsers Refresh/actualization explain"
y_format_message_html
}
# -----------------------------------------------------------
# Main
# -----------------------------------------------------------
case "$1" in
skin_set)
skin_set $2 ;;
skin_get)
skin_get ;;
*)
echo "Parameter falsch: $*" ;;
esac

View File

@@ -10,7 +10,7 @@
# Settings : Skins
# ===========================================================
# -----------------------------------------------------------
# Skin Liste
# Skin List [Function inactive]
# -----------------------------------------------------------
skin_get()
{
@@ -33,7 +33,7 @@ skin_get()
echo "$html_option_list"
}
# -----------------------------------------------------------
# Skin setzen : css ueberschreiben $1=Skin-Name
# Set Skin: override css $1=Skin-Name [Function inactive]
# -----------------------------------------------------------
skin_set()
{
@@ -167,14 +167,14 @@ upload_copy()
# -----------------------------------------------------------
bootlogo_upload()
{
msg="Boot-Logo neu gesetzt"
msg="Boot-Logo installed"
upload_copy "$y_boot_logo"
y_format_message_html
}
# -----------------------------------------------------------
bootlogo_lcd_upload()
{
msg="Boot-Logo-LCD neu gesetzt"
msg="Boot-Logo-LCD installed"
upload_copy "$y_boot_logo_lcd"
y_format_message_html
}
@@ -267,7 +267,7 @@ do_unmount()
}
# -----------------------------------------------------------
# AutoMount
# deaktive mount "#" replaces "---" and "=" replaced ",,"
# deactivate mount "#" replaces "---" and "=" replaced ",,"
# -----------------------------------------------------------
do_automount_list()
{
@@ -282,12 +282,15 @@ do_automount_list()
i=`expr $i + 1`
done
}
# -----------------------------------------------------------
do_automount_getline()
{
mountname=`echo "$2"|sed -e "s/---/#/g"`
cat $1|sed -n "/^[#]*$mountname[^a-zA-Z0-9]/p"
}
# -----------------------------------------------------------
# $1:filename, $2:mountname, $3-*:mountstring
# -----------------------------------------------------------
do_automount_setline()
{
if ! [ -e $1 ]; then
@@ -537,44 +540,45 @@ restart_neutrino()
#debug
echo "call:$*" >> "/tmp/debug.txt"
case "$1" in
skin_set) skin_set $2 ;;
skin_get) skin_get ;;
image_upload) image_upload ;;
image_backup) image_backup_mtd $2; echo "/tmp/flash_mtd$2.img" ;;
image_flash) shift 1; flash_mtd $* ;;
skin_set) skin_set $2 ;;
skin_get) skin_get ;;
image_upload) image_upload ;;
image_backup) image_backup_mtd $2; echo "/tmp/flash_mtd$2.img" ;;
image_flash) shift 1; flash_mtd $* ;;
image_flash_free_tmp) rm -r /tmp/*.img ;;
image_delete) image_delete_download_page ;;
bootlogo_upload) bootlogo_upload ;;
image_delete) image_delete_download_page ;;
bootlogo_upload) bootlogo_upload ;;
bootlogo_lcd_upload) bootlogo_lcd_upload ;;
ucodes_upload) ucodes_upload $2 ;;
zapit_upload) zapit_upload $2 ;;
kernel-stack) msg=`dmesg`; y_format_message_html ;;
ps) msg=`ps`; y_format_message_html ;;
free) f=`free`; p=`df -h`; msg="RAM Memory use\n-------------------\n$f\n\nPartitions\n-------------------\n$p"
y_format_message_html ;;
yreboot) yreboot; echo "Reboot..." ;;
check_yWeb_conf) check_Y_Web_conf ;;
rcsim) rcsim $2 >/dev/null ;;
domount) shift 1; do_mount $* ;;
dounmount) shift 1; do_unmount $* ;;
cmd) shift 1; do_cmd $* ;;
installer) shift 1; do_installer $* 2>&1 ;;
ext_uninstaller) shift 1; do_ext_uninstaller $* 2>&1 ;;
ext_installer) shift 1; do_ext_installer $* 2>&1 ;;
proc) shift 1; proc $* ;;
wol) shift 1; wol $* ;;
lcshot) shift 1; do_lcshot $* ;;
fbshot) shift 1; do_fbshot $* ;;
fbshot_clear) do_fbshot_clear ;;
ucodes_upload) ucodes_upload $2 ;;
zapit_upload) zapit_upload $2 ;;
kernel-stack) msg=`dmesg`; y_format_message_html ;;
ps) msg=`ps`; y_format_message_html ;;
free) f=`free`; p=`df -h`; msg="RAM Memory use\n-------------------\n$f\n\nPartitions\n-------------------\n$p"
y_format_message_html ;;
yreboot) yreboot; echo "Reboot..." ;;
check_yWeb_conf) check_Y_Web_conf ;;
rcsim) rcsim $2 >/dev/null ;;
domount) shift 1; do_mount $* ;;
dounmount) shift 1; do_unmount $* ;;
cmd) shift 1; do_cmd $* ;;
installer) shift 1; do_installer $* 2>&1 ;;
ext_uninstaller) shift 1; do_ext_uninstaller $* 2>&1 ;;
ext_installer) shift 1; do_ext_installer $* 2>&1 ;;
proc) shift 1; proc $* ;;
wol) shift 1; wol $* ;;
lcshot) shift 1; do_lcshot $* ;;
fbshot) shift 1; do_fbshot $* ;;
fbshot_clear) do_fbshot_clear ;;
get_update_version_dbox) wget -O /tmp/version.txt "http://www.yjogol.com/download/Y_Version.txt" ;;
get_update_version_coolstream) wget -O /tmp/version.txt "http://www.yjogol.com/download/coolstream/Y_Version.txt" ;;
settings_backup_restore) shift 1; do_settings_backup_restore $* ;;
exec_cmd) shift 1; $* ;;
automount_list) shift 1; do_automount_list $* ;;
automount_getline) shift 1; do_automount_getline $* ;;
automount_setline) shift 1; do_automount_setline $* ;;
restart_neutrino) restart_neutrino ;;
have_plugin_scripts) find /var/tuxbox/plugins -name '*.sh' ;;
exec_cmd) shift 1; $* ;;
automount_list) shift 1; do_automount_list $* ;;
automount_getline) shift 1; do_automount_getline $* ;;
automount_setline) shift 1; do_automount_setline $* ;;
restart_neutrino) restart_neutrino ;;
have_plugin_scripts) find /var/tuxbox/plugins -name '*.sh' ;;
timer_get_tvinfo)
shift 1
rm -r /tmp/tvinfo.xml
@@ -646,7 +650,7 @@ case "$1" in
df /tmp|grep /tmp
;;
*)
echo "[Y_Tools.sh] Parameter falsch: $*" ;;
echo "[Y_Tools.sh] Parameter wrong: $*" ;;
esac

View File

@@ -5,6 +5,11 @@
# $Revision$
# -----------------------------------------------------------
# -----------------------------------------------------------
# Definitions
# -----------------------------------------------------------
boxtype="coolstream"
# -----------------------------------------------------------
# Pathes
# -----------------------------------------------------------