mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
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:
@@ -1,6 +1,6 @@
|
|||||||
installdir = $(DATADIR)/neutrino/httpd/scripts
|
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:
|
install-data-hook:
|
||||||
chmod 0755 $(DATADIR)/neutrino/httpd/scripts/api.sh
|
chmod 0755 $(DATADIR)/neutrino/httpd/scripts/api.sh
|
||||||
|
@@ -11,14 +11,18 @@
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
live_lock()
|
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/rc?lock" >/dev/null
|
||||||
call_webserver "control/zapto?stopplayback" >/dev/null
|
call_webserver "control/zapto?stopplayback" >/dev/null
|
||||||
}
|
}
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
live_unlock()
|
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/rc?unlock" >/dev/null
|
||||||
call_webserver "control/zapto?startplayback" >/dev/null
|
call_webserver "control/zapto?startplayback" >/dev/null
|
||||||
}
|
}
|
||||||
@@ -26,13 +30,17 @@ live_unlock()
|
|||||||
prepare_tv()
|
prepare_tv()
|
||||||
{
|
{
|
||||||
# SPTS on
|
# 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()
|
prepare_radio()
|
||||||
{
|
{
|
||||||
# SPTS off
|
# 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
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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
|
|
||||||
|
|
@@ -10,7 +10,7 @@
|
|||||||
# Settings : Skins
|
# Settings : Skins
|
||||||
# ===========================================================
|
# ===========================================================
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Skin Liste
|
# Skin List [Function inactive]
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
skin_get()
|
skin_get()
|
||||||
{
|
{
|
||||||
@@ -33,7 +33,7 @@ skin_get()
|
|||||||
echo "$html_option_list"
|
echo "$html_option_list"
|
||||||
}
|
}
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Skin setzen : css ueberschreiben $1=Skin-Name
|
# Set Skin: override css $1=Skin-Name [Function inactive]
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
skin_set()
|
skin_set()
|
||||||
{
|
{
|
||||||
@@ -167,14 +167,14 @@ upload_copy()
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
bootlogo_upload()
|
bootlogo_upload()
|
||||||
{
|
{
|
||||||
msg="Boot-Logo neu gesetzt"
|
msg="Boot-Logo installed"
|
||||||
upload_copy "$y_boot_logo"
|
upload_copy "$y_boot_logo"
|
||||||
y_format_message_html
|
y_format_message_html
|
||||||
}
|
}
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
bootlogo_lcd_upload()
|
bootlogo_lcd_upload()
|
||||||
{
|
{
|
||||||
msg="Boot-Logo-LCD neu gesetzt"
|
msg="Boot-Logo-LCD installed"
|
||||||
upload_copy "$y_boot_logo_lcd"
|
upload_copy "$y_boot_logo_lcd"
|
||||||
y_format_message_html
|
y_format_message_html
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ do_unmount()
|
|||||||
}
|
}
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# AutoMount
|
# AutoMount
|
||||||
# deaktive mount "#" replaces "---" and "=" replaced ",,"
|
# deactivate mount "#" replaces "---" and "=" replaced ",,"
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
do_automount_list()
|
do_automount_list()
|
||||||
{
|
{
|
||||||
@@ -282,12 +282,15 @@ do_automount_list()
|
|||||||
i=`expr $i + 1`
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
# -----------------------------------------------------------
|
||||||
do_automount_getline()
|
do_automount_getline()
|
||||||
{
|
{
|
||||||
mountname=`echo "$2"|sed -e "s/---/#/g"`
|
mountname=`echo "$2"|sed -e "s/---/#/g"`
|
||||||
cat $1|sed -n "/^[#]*$mountname[^a-zA-Z0-9]/p"
|
cat $1|sed -n "/^[#]*$mountname[^a-zA-Z0-9]/p"
|
||||||
}
|
}
|
||||||
|
# -----------------------------------------------------------
|
||||||
# $1:filename, $2:mountname, $3-*:mountstring
|
# $1:filename, $2:mountname, $3-*:mountstring
|
||||||
|
# -----------------------------------------------------------
|
||||||
do_automount_setline()
|
do_automount_setline()
|
||||||
{
|
{
|
||||||
if ! [ -e $1 ]; then
|
if ! [ -e $1 ]; then
|
||||||
@@ -537,44 +540,45 @@ restart_neutrino()
|
|||||||
#debug
|
#debug
|
||||||
echo "call:$*" >> "/tmp/debug.txt"
|
echo "call:$*" >> "/tmp/debug.txt"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
skin_set) skin_set $2 ;;
|
skin_set) skin_set $2 ;;
|
||||||
skin_get) skin_get ;;
|
skin_get) skin_get ;;
|
||||||
image_upload) image_upload ;;
|
image_upload) image_upload ;;
|
||||||
image_backup) image_backup_mtd $2; echo "/tmp/flash_mtd$2.img" ;;
|
image_backup) image_backup_mtd $2; echo "/tmp/flash_mtd$2.img" ;;
|
||||||
image_flash) shift 1; flash_mtd $* ;;
|
image_flash) shift 1; flash_mtd $* ;;
|
||||||
image_flash_free_tmp) rm -r /tmp/*.img ;;
|
image_flash_free_tmp) rm -r /tmp/*.img ;;
|
||||||
image_delete) image_delete_download_page ;;
|
image_delete) image_delete_download_page ;;
|
||||||
bootlogo_upload) bootlogo_upload ;;
|
bootlogo_upload) bootlogo_upload ;;
|
||||||
bootlogo_lcd_upload) bootlogo_lcd_upload ;;
|
bootlogo_lcd_upload) bootlogo_lcd_upload ;;
|
||||||
ucodes_upload) ucodes_upload $2 ;;
|
ucodes_upload) ucodes_upload $2 ;;
|
||||||
zapit_upload) zapit_upload $2 ;;
|
zapit_upload) zapit_upload $2 ;;
|
||||||
kernel-stack) msg=`dmesg`; y_format_message_html ;;
|
kernel-stack) msg=`dmesg`; y_format_message_html ;;
|
||||||
ps) msg=`ps`; 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"
|
free) f=`free`; p=`df -h`; msg="RAM Memory use\n-------------------\n$f\n\nPartitions\n-------------------\n$p"
|
||||||
y_format_message_html ;;
|
y_format_message_html ;;
|
||||||
yreboot) yreboot; echo "Reboot..." ;;
|
yreboot) yreboot; echo "Reboot..." ;;
|
||||||
check_yWeb_conf) check_Y_Web_conf ;;
|
check_yWeb_conf) check_Y_Web_conf ;;
|
||||||
rcsim) rcsim $2 >/dev/null ;;
|
rcsim) rcsim $2 >/dev/null ;;
|
||||||
domount) shift 1; do_mount $* ;;
|
domount) shift 1; do_mount $* ;;
|
||||||
dounmount) shift 1; do_unmount $* ;;
|
dounmount) shift 1; do_unmount $* ;;
|
||||||
cmd) shift 1; do_cmd $* ;;
|
cmd) shift 1; do_cmd $* ;;
|
||||||
installer) shift 1; do_installer $* 2>&1 ;;
|
installer) shift 1; do_installer $* 2>&1 ;;
|
||||||
ext_uninstaller) shift 1; do_ext_uninstaller $* 2>&1 ;;
|
ext_uninstaller) shift 1; do_ext_uninstaller $* 2>&1 ;;
|
||||||
ext_installer) shift 1; do_ext_installer $* 2>&1 ;;
|
ext_installer) shift 1; do_ext_installer $* 2>&1 ;;
|
||||||
proc) shift 1; proc $* ;;
|
proc) shift 1; proc $* ;;
|
||||||
wol) shift 1; wol $* ;;
|
wol) shift 1; wol $* ;;
|
||||||
lcshot) shift 1; do_lcshot $* ;;
|
lcshot) shift 1; do_lcshot $* ;;
|
||||||
fbshot) shift 1; do_fbshot $* ;;
|
fbshot) shift 1; do_fbshot $* ;;
|
||||||
fbshot_clear) do_fbshot_clear ;;
|
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_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" ;;
|
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 $* ;;
|
settings_backup_restore) shift 1; do_settings_backup_restore $* ;;
|
||||||
exec_cmd) shift 1; $* ;;
|
exec_cmd) shift 1; $* ;;
|
||||||
automount_list) shift 1; do_automount_list $* ;;
|
automount_list) shift 1; do_automount_list $* ;;
|
||||||
automount_getline) shift 1; do_automount_getline $* ;;
|
automount_getline) shift 1; do_automount_getline $* ;;
|
||||||
automount_setline) shift 1; do_automount_setline $* ;;
|
automount_setline) shift 1; do_automount_setline $* ;;
|
||||||
restart_neutrino) restart_neutrino ;;
|
restart_neutrino) restart_neutrino ;;
|
||||||
have_plugin_scripts) find /var/tuxbox/plugins -name '*.sh' ;;
|
have_plugin_scripts) find /var/tuxbox/plugins -name '*.sh' ;;
|
||||||
|
|
||||||
timer_get_tvinfo)
|
timer_get_tvinfo)
|
||||||
shift 1
|
shift 1
|
||||||
rm -r /tmp/tvinfo.xml
|
rm -r /tmp/tvinfo.xml
|
||||||
@@ -646,7 +650,7 @@ case "$1" in
|
|||||||
df /tmp|grep /tmp
|
df /tmp|grep /tmp
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "[Y_Tools.sh] Parameter falsch: $*" ;;
|
echo "[Y_Tools.sh] Parameter wrong: $*" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,6 +5,11 @@
|
|||||||
# $Revision$
|
# $Revision$
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
# Definitions
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
boxtype="coolstream"
|
||||||
|
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
# Pathes
|
# Pathes
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user