mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
- yWeb: cleanup
Conflicts: data/y-web/Y_Blocks.txt data/y-web/Y_Live_Menue.yhtm data/y-web/Y_Tools_Flash_Upload.yhtm data/y-web/Y_Version.txt data/y-web/extentions/boxinfo/files/httpd/scripts/Y_Ext_BoxInfo.sh data/y-web/languages/Czech data/y-web/languages/Deutsch data/y-web/languages/English data/y-web/languages/Makefile.am data/y-web/languages/Polski data/y-web/languages/Portuguese data/y-web/languages/Slovak data/y-web/scripts/Y_NI_Tools.sh data/y-web/scripts/Y_Tools.sh data/y-web/scripts/api.sh data/y-web/ywidget.css Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
installdir = $(PRIVATE_HTTPDDIR)/scripts
|
||||
|
||||
install_SCRIPTS = \
|
||||
api.sh \
|
||||
_Y_Globals.sh \
|
||||
_Y_Library.sh \
|
||||
Y_Live.sh \
|
||||
Y_Tools.sh
|
||||
|
||||
# file manager
|
||||
install_SCRIPTS += \
|
||||
Y_NAS.sh
|
||||
|
||||
install-data-hook:
|
||||
chmod 0755 $(DESTDIR)$(PRIVATE_HTTPDDIR)/scripts/api.sh
|
||||
chmod 0755 $(DESTDIR)$(PRIVATE_HTTPDDIR)/scripts/Y_*.sh
|
||||
installdir = $(PRIVATE_HTTPDDIR)/scripts
|
||||
|
||||
install_SCRIPTS = \
|
||||
_Y_Globals.sh \
|
||||
_Y_Library.sh \
|
||||
Y_Tools.sh
|
||||
|
||||
# file manager
|
||||
install_SCRIPTS += \
|
||||
Y_NAS.sh
|
||||
|
||||
|
@@ -1,117 +0,0 @@
|
||||
#!/bin/sh
|
||||
# -----------------------------------------------------------
|
||||
# Live (yjogol)
|
||||
# $Date$
|
||||
# $Revision$
|
||||
# -----------------------------------------------------------
|
||||
|
||||
. ./_Y_Globals.sh
|
||||
. ./_Y_Library.sh
|
||||
|
||||
# -----------------------------------------------------------
|
||||
live_lock()
|
||||
{
|
||||
call_webserver "control/rc?lock" >/dev/null
|
||||
call_webserver "control/zapto?stopplayback" >/dev/null
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
live_unlock()
|
||||
{
|
||||
call_webserver "control/rc?unlock" >/dev/null
|
||||
call_webserver "control/zapto?startplayback" >/dev/null
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
prepare_tv()
|
||||
{
|
||||
# SPTS on
|
||||
if [ "$boxtype" != "coolstream" ]; then
|
||||
call_webserver "control/system?setAViAExtPlayBack=spts" >/dev/null
|
||||
fi
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
prepare_radio()
|
||||
{
|
||||
# SPTS off
|
||||
if [ "$boxtype" != "coolstream" ]; then
|
||||
call_webserver "control/system?setAViAExtPlayBack=pes" >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------
|
||||
# Main
|
||||
# -----------------------------------
|
||||
# echo "$1" >/tmp/debug.txt
|
||||
echo "$*"
|
||||
case "$1" in
|
||||
zapto)
|
||||
if [ "$2" != "" ]
|
||||
then
|
||||
call_webserver "control/zapto?$2" >/dev/null
|
||||
fi
|
||||
;;
|
||||
|
||||
switchto)
|
||||
if [ "$2" = "Radio" ]
|
||||
then
|
||||
call_webserver "control/setmode?radio" >/dev/null
|
||||
else
|
||||
call_webserver "control/setmode?tv" >/dev/null
|
||||
fi
|
||||
;;
|
||||
|
||||
url)
|
||||
url=`buildStreamingRawURL`
|
||||
echo "$url" ;;
|
||||
|
||||
audio-url)
|
||||
url=`buildStreamingAudioRawURL`
|
||||
echo "$url" ;;
|
||||
|
||||
live_lock)
|
||||
live_lock ;;
|
||||
|
||||
live_unlock)
|
||||
live_unlock ;;
|
||||
|
||||
dboxIP)
|
||||
buildLocalIP ;;
|
||||
|
||||
prepare_radio)
|
||||
prepare_radio
|
||||
Y_APid=`call_webserver "control/yweb?radio_stream_pid"`
|
||||
url="http://$2:31338/$Y_APid"
|
||||
echo "$url" > $y_tmp_m3u
|
||||
echo "$url" > $y_tmp_pls
|
||||
;;
|
||||
|
||||
prepare_tv)
|
||||
prepare_tv
|
||||
;;
|
||||
|
||||
udp_stream)
|
||||
if [ "$2" = "start" ]
|
||||
then
|
||||
shift 2
|
||||
killall streamts
|
||||
killall streampes
|
||||
killall udpstreamts
|
||||
if [ -e $y_path_varbin/udpstreamts ]
|
||||
then
|
||||
$y_path_varbin/udpstreamts $* &
|
||||
else
|
||||
udpstreamts $* &
|
||||
fi
|
||||
pidof udpstreamts >/tmp/udpstreamts.pid
|
||||
fi
|
||||
if [ "$2" = "stop" ]
|
||||
then
|
||||
killall udpstreamts
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Parameter wrong: $*" ;;
|
||||
esac
|
||||
|
||||
|
||||
|
@@ -1,72 +1,60 @@
|
||||
#!/bin/sh
|
||||
# -----------------------------------------------------------
|
||||
# yWeb Extension: Filemgr (by yjogol)
|
||||
# yCVS: $Date: 2007-12-29 08:20:30 $
|
||||
# yCVS: $Revision: 1.1 $
|
||||
# -----------------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Main
|
||||
# -----------------------------------------------------------
|
||||
|
||||
case "$1" in
|
||||
list_users)
|
||||
cat $fpasswd|sed 's/^\([^:]*\).*/<input type=radio name=users value=\1>\1<br>/' ;;
|
||||
|
||||
cat $fpasswd|sed 's/^\([^:]*\).*/<input type=radio name=users value=\1>\1<br>/'
|
||||
;;
|
||||
filemgr_list)
|
||||
shift 1
|
||||
ls -al $* ;;
|
||||
|
||||
ls -al $*
|
||||
;;
|
||||
filemgr_chmod)
|
||||
shift 1
|
||||
chmod $*
|
||||
;;
|
||||
|
||||
;;
|
||||
filemgr_mkdir)
|
||||
shift 1
|
||||
mkdir $*
|
||||
;;
|
||||
|
||||
;;
|
||||
filemgr_rm)
|
||||
shift 1
|
||||
rm -f $*
|
||||
;;
|
||||
|
||||
;;
|
||||
filemgr_rmdir)
|
||||
shift 1
|
||||
rm -rf $*
|
||||
;;
|
||||
|
||||
;;
|
||||
filemgr_upload)
|
||||
shift 1
|
||||
mv /tmp/upload.tmp "$1/$2"
|
||||
rm -f /tmp/upload.tmp
|
||||
;;
|
||||
|
||||
;;
|
||||
filemgr_ren)
|
||||
shift 1
|
||||
mv -f $1 $2
|
||||
;;
|
||||
|
||||
;;
|
||||
filemgr_copy)
|
||||
shift 1
|
||||
cp -r -f $1 $2
|
||||
;;
|
||||
nhttpd_can_sendall)
|
||||
grep sendAll=true %(CONFIGDIR)/nhttpd.conf
|
||||
;;
|
||||
;;
|
||||
filemgr_check_movieplayer_xml)
|
||||
shift 1
|
||||
grep "neutrino commandversion" $*
|
||||
;;
|
||||
;;
|
||||
filemgr_vlc_file)
|
||||
shift 1
|
||||
echo "$*" >/tmp/vlc.m3u
|
||||
;;
|
||||
|
||||
;;
|
||||
nhttpd_can_sendall)
|
||||
grep sendAll=true %(CONFIGDIR)/nhttpd.conf
|
||||
;;
|
||||
*)
|
||||
echo "[Y_NAS.sh] Parameter falsch: $*" ;;
|
||||
echo "[Y_NAS.sh] Parameter falsch: $*"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
# -----------------------------------------------------------
|
||||
# Tools (yjogol)
|
||||
# $Date$
|
||||
# $Revision$
|
||||
# -----------------------------------------------------------
|
||||
|
||||
. ./_Y_Globals.sh
|
||||
. ./_Y_Library.sh
|
||||
|
||||
# ===========================================================
|
||||
# Settings : Styles
|
||||
# ===========================================================
|
||||
@@ -46,6 +46,7 @@ style_get()
|
||||
done
|
||||
echo "$html_option_list"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Set Style: override Y_Main.css $1=Style-Name
|
||||
# -----------------------------------------------------------
|
||||
@@ -69,6 +70,7 @@ style_set()
|
||||
config_set_value_direct $y_config_Y_Web 'style'
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Image Backup - build form
|
||||
# -----------------------------------------------------------
|
||||
@@ -84,93 +86,7 @@ image_upload()
|
||||
fi
|
||||
y_format_message_html
|
||||
}
|
||||
# ===========================================================
|
||||
# Flashimage
|
||||
# ===========================================================
|
||||
# -----------------------------------
|
||||
# Flash-Backup ($1=mtd Nummer)
|
||||
# -----------------------------------
|
||||
image_backup_mtd()
|
||||
{
|
||||
rm /tmp/*.img
|
||||
cat /dev/mtd/$1 > /tmp/flash_mtd$1.img
|
||||
}
|
||||
# -----------------------------------
|
||||
# Sende Download-Page ($1=mtd Nummer)
|
||||
# -----------------------------------
|
||||
# -----------------------------------
|
||||
image_delete_download_page()
|
||||
{
|
||||
rm -r /tmp/*.img
|
||||
# msg="<div class='y_work_box'><b>The image file in tmp was extinguished.</b></div>"
|
||||
# y_format_message_html
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
# Flash ($1=mtd Nummer) Upload-File $2=true/false =simulate
|
||||
# -----------------------------------------------------------
|
||||
flash_mtd()
|
||||
{
|
||||
simulate="true"
|
||||
if [ "$2" = "false" ]
|
||||
then
|
||||
simulate="false"
|
||||
fi
|
||||
rm /tmp/*.img
|
||||
if [ -s "$y_upload_file" ]
|
||||
then
|
||||
echo "" >/tmp/e.txt
|
||||
msg_nmsg "Image%20%20flashing!"
|
||||
if [ "$simulate" = "false" ]
|
||||
then
|
||||
umount /hdd #yet: fixed setting
|
||||
fcp -v "$y_upload_file" /dev/mtd/$1 >/tmp/e.txt
|
||||
else #simulation/DEMO
|
||||
i="0"
|
||||
while test $i -le 10
|
||||
do
|
||||
p=`expr $i \* 10`
|
||||
b=`expr $i \* 63`
|
||||
b=`expr $b / 10`
|
||||
echo -e "\rDEMO: Erasing blocks: $b/63 ($p%)" >>/tmp/e.txt
|
||||
i=`expr $i + 1`
|
||||
sleep 1
|
||||
done
|
||||
i="0"
|
||||
while test $i -le 20
|
||||
do
|
||||
p=`expr $i \* 5`
|
||||
b=`expr $i \* 8064`
|
||||
b=`expr $b / 20`
|
||||
echo -e "\rDEMO: Writing data: $b k/8064k ($p%)" >>/tmp/e.txt
|
||||
i=`expr $i + 1`
|
||||
sleep 2
|
||||
done
|
||||
i="0"
|
||||
while test $i -le 5
|
||||
do
|
||||
p=`expr $i \* 20`
|
||||
b=`expr $i \* 8064`
|
||||
b=`expr $b / 5`
|
||||
echo -e "\rDEMO: Verifying data: $b k/8064k ($p%)" >>/tmp/e.txt
|
||||
i=`expr $i + 1`
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
msg_nmsg "flashing%20ready.%20Reboot..."
|
||||
msg="flashing done ... please reboot box now ..."
|
||||
msg="$msg <script language='JavaScript' type='text/javascript'>window.setTimeout('parent.do_image_flash_ready()',1000)</script>"
|
||||
y_format_message_html
|
||||
|
||||
if [ "$simulate" = "false" ]
|
||||
then
|
||||
busybox reboot -d10
|
||||
fi
|
||||
else
|
||||
msg="Upload-Problem.<br>Try again, please."
|
||||
msg="$msg <script language='JavaScript' type='text/javascript'>window.setTimeout('parent.do_image_flash_ready()',1000)</script>"
|
||||
y_format_message_html
|
||||
fi
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
# copies Uploadfile to $1
|
||||
# -----------------------------------------------------------
|
||||
@@ -183,20 +99,7 @@ upload_copy()
|
||||
msg="Upload-Problem.<br>Try again, please."
|
||||
fi
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
bootlogo_upload()
|
||||
{
|
||||
msg="Boot-Logo installed"
|
||||
upload_copy "$y_boot_logo"
|
||||
y_format_message_html
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
bootlogo_lcd_upload()
|
||||
{
|
||||
msg="Boot-Logo-LCD installed"
|
||||
upload_copy "$y_boot_logo_lcd"
|
||||
y_format_message_html
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
zapit_upload()
|
||||
{
|
||||
@@ -204,6 +107,7 @@ zapit_upload()
|
||||
upload_copy "$y_path_zapit/$1"
|
||||
y_format_message_html
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Mount from Neutrino-Settings $1=nr
|
||||
# -----------------------------------------------------------
|
||||
@@ -248,13 +152,13 @@ do_mount()
|
||||
case "$fstype" in
|
||||
0) # nfs
|
||||
cmd="mount -t nfs $ip:$dir $local_dir"
|
||||
;;
|
||||
;;
|
||||
1) # cifs
|
||||
cmd="mount -t cifs //$ip/$dir $local_dir -o username=$username,password=$password";
|
||||
;;
|
||||
;;
|
||||
2) # lufs
|
||||
cmd="lufsd none $local_dir -o fs=ftpfs,username=$username,password=$password,host=$ip,root=/$dir";
|
||||
;;
|
||||
;;
|
||||
default)
|
||||
echo "mount type not supported"
|
||||
esac
|
||||
@@ -283,6 +187,7 @@ do_mount()
|
||||
msg="mount cmd:$cmd<br><br>res=$res<br>view Mounts;<br>$m"
|
||||
y_format_message_html
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# unmount $1=local_dir
|
||||
# -----------------------------------------------------------
|
||||
@@ -290,6 +195,7 @@ do_unmount()
|
||||
{
|
||||
umount $1
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# AutoMount
|
||||
# deactivate mount "#" replaces "---" and "=" replaced ",,"
|
||||
@@ -307,12 +213,14 @@ 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"
|
||||
cat $1 | sed -n "/^[#]*$mountname[^a-zA-Z0-9]/p"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# $1:filename, $2:mountname, $3-*:mountstring
|
||||
# -----------------------------------------------------------
|
||||
@@ -337,6 +245,7 @@ do_automount_setline()
|
||||
|
||||
kill -HUP `cat /var/run/automount.pid`
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Execute shell command
|
||||
# 1: directory 2: append [true|false] 3+: cmd
|
||||
@@ -371,6 +280,7 @@ do_cmd()
|
||||
echo 'parent.document.f.cmd.focus();'
|
||||
echo '</script></body></html>'
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# yInstaller
|
||||
# un-tar uploaded file to /tmp. Execute included install.sh
|
||||
@@ -404,7 +314,7 @@ do_installer()
|
||||
echo '</head>'
|
||||
echo "<body><a href='$y_out_html'>If automatic forwarding does not go.</a>"
|
||||
echo '</body></html>'
|
||||
# cat $y_out_html
|
||||
#cat $y_out_html
|
||||
else
|
||||
echo '<html><head>'
|
||||
echo '<link rel="stylesheet" type="text/css" href="/Y_Main.css">'
|
||||
@@ -450,6 +360,7 @@ do_ext_installer()
|
||||
echo "error: $y_install not found. wget=$wgetlog $e"
|
||||
fi
|
||||
}
|
||||
|
||||
do_ext_uninstaller()
|
||||
{
|
||||
uinst="%(CONFIGDIR)/ext/uninstall.sh"
|
||||
@@ -458,6 +369,7 @@ do_ext_uninstaller()
|
||||
`$uinst $1_uninstall.inc`
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# view /proc/$1 Informations
|
||||
# -----------------------------------------------------------
|
||||
@@ -467,6 +379,7 @@ proc()
|
||||
msg="<b>proc: $1</b><br><br>$msg"
|
||||
y_format_message_html
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# wake up $1=MAC
|
||||
# -----------------------------------------------------------
|
||||
@@ -478,6 +391,7 @@ wol()
|
||||
msg="<b>Wake on LAN $1</b><br><br>$msg"
|
||||
y_format_message_html
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# lcd shot
|
||||
# $1= optionen | leer
|
||||
@@ -490,6 +404,7 @@ do_lcshot()
|
||||
$y_path_bin/lcshot $*
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# osd shot
|
||||
# $1= fbshot | grab
|
||||
@@ -512,6 +427,7 @@ do_fbshot()
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# delete fbshot created graphics
|
||||
# -----------------------------------------------------------
|
||||
@@ -520,6 +436,7 @@ do_fbshot_clear()
|
||||
rm /tmp/*.bmp
|
||||
rm /tmp/*.png
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# delete screenshots
|
||||
# -----------------------------------------------------------
|
||||
@@ -527,6 +444,7 @@ do_screenshot_clear()
|
||||
{
|
||||
rm -f /tmp/*.png
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Settings Backup/Restore
|
||||
# -----------------------------------------------------------
|
||||
@@ -542,7 +460,6 @@ do_settings_backup_restore()
|
||||
filename=$(ls -1 -tr $workdir/settings_* | tail -1)
|
||||
echo "$filename"
|
||||
;;
|
||||
|
||||
restore)
|
||||
if [ -s "$y_upload_file" ]
|
||||
then
|
||||
@@ -554,81 +471,57 @@ do_settings_backup_restore()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
restart_neutrino()
|
||||
{
|
||||
echo "fixme"
|
||||
# kill -HUP `pidof neutrino`
|
||||
#kill -HUP `pidof neutrino`
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Main
|
||||
# -----------------------------------------------------------
|
||||
#debug
|
||||
# echo "call:$*" >> "/tmp/debug.txt"
|
||||
# debug
|
||||
#echo "call:$*" >> "/tmp/debug.txt"
|
||||
case "$1" in
|
||||
style_set) style_set $2 ;;
|
||||
style_get) style_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 ;;
|
||||
bootlogo_lcd_upload) bootlogo_lcd_upload ;;
|
||||
zapit_upload) zapit_upload $2 ;;
|
||||
kernel-stack) msg=`dmesg`; y_format_message_html ;;
|
||||
ps) msg=`ps aux`; 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) reboot; echo "Reboot..." ;;
|
||||
ps) msg=`ps aux`; 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) reboot; 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 ;;
|
||||
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 $* ;;
|
||||
proc) shift 1; proc $* ;;
|
||||
wol) shift 1; wol $* ;;
|
||||
lcshot) shift 1; do_lcshot $* ;;
|
||||
fbshot) shift 1; do_fbshot $* ;;
|
||||
fbshot_clear) do_fbshot_clear ;;
|
||||
screenshot_clear) do_screenshot_clear ;;
|
||||
get_update_version) wget -q -O /tmp/version.txt "https://raw.githubusercontent.com/tuxbox-neutrino/gui-neutrino/master/data/y-web/Y_Version.txt" ;;
|
||||
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_getline) shift 1; do_automount_getline $* ;;
|
||||
automount_setline) shift 1; do_automount_setline $* ;;
|
||||
restart_neutrino) restart_neutrino ;;
|
||||
have_plugin_scripts) find %(PLUGINDIR_VAR) -name '*.sh' ;;
|
||||
|
||||
timer_get_tvinfo)
|
||||
shift 1
|
||||
rm -r /tmp/tvinfo.xml
|
||||
res=$(curl -o /tmp/tvinfo.xml -vs "https://www.tvinfo.de/share/openepg/schedule.php?username=$1&password=$2" 2>&1)
|
||||
if ! [ -s /tmp/tvinfo.xml ]
|
||||
then
|
||||
res="$res File empty!"
|
||||
fi
|
||||
echo "$res"
|
||||
;;
|
||||
|
||||
timer_get_klack)
|
||||
config_open $y_config_Y_Web
|
||||
url=`config_get_value "klack_url"`
|
||||
klack_url=`echo "$url"|sed -e 's/;/\&/g'`
|
||||
securitycode=`config_get_value "klack_securitycode"`
|
||||
klack_url=`echo "$klack_url&secCode=$securitycode"`
|
||||
wget -O /tmp/klack.xml "$klack_url" 2>&1 ;;
|
||||
have_plugin_scripts) find %(PLUGINDIR_VAR) -name '*.sh' ;;
|
||||
|
||||
restart_sectionsd)
|
||||
killall sectionsd
|
||||
sectionsd >/dev/null 2>&1
|
||||
msg="sectionsd reboot. ok."
|
||||
y_format_message_html
|
||||
;;
|
||||
|
||||
;;
|
||||
get_synctimer_channels)
|
||||
if [ -e "$y_path_config/channels.txt" ]
|
||||
then
|
||||
@@ -636,8 +529,7 @@ case "$1" in
|
||||
else
|
||||
cat $y_path_httpd/channels.txt
|
||||
fi
|
||||
;;
|
||||
|
||||
;;
|
||||
get_extension_list)
|
||||
if [ -e "$y_path_config/extentions.txt" ]
|
||||
then
|
||||
@@ -645,19 +537,16 @@ case "$1" in
|
||||
else
|
||||
cat $y_path_httpd/extentions.txt
|
||||
fi
|
||||
;;
|
||||
|
||||
;;
|
||||
write_extension_list)
|
||||
shift 1
|
||||
echo "$*" >$y_path_config/extentions.txt
|
||||
;;
|
||||
|
||||
;;
|
||||
url_get)
|
||||
shift 1
|
||||
res=`wget -O /tmp/$2 "$1" >/tmp/url.log 2>&1`
|
||||
cat /tmp/$2
|
||||
;;
|
||||
|
||||
;;
|
||||
mtd_space|var_space)
|
||||
df | while read fs rest; do
|
||||
case ${fs:0:3} in
|
||||
@@ -667,13 +556,13 @@ case "$1" in
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
;;
|
||||
tmp_space)
|
||||
df /tmp|grep /tmp
|
||||
;;
|
||||
;;
|
||||
get_hostname)
|
||||
echo -n $(hostname)
|
||||
;;
|
||||
*)
|
||||
echo "[Y_Tools.sh] Parameter wrong: $*" ;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
@@ -1,14 +1,12 @@
|
||||
#!/bin/sh
|
||||
# -----------------------------------------------------------
|
||||
# Y Globals (yjogol)
|
||||
# $Date$
|
||||
# $Revision$
|
||||
# -----------------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Definitions
|
||||
# -----------------------------------------------------------
|
||||
boxtype="coolstream"
|
||||
#boxtype="coolstream"
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Paths
|
||||
@@ -23,22 +21,16 @@ y_path_config="%(CONFIGDIR)"
|
||||
y_path_tmp="/tmp"
|
||||
y_path_zapit="%(ZAPITDIR)"
|
||||
|
||||
y_path_plugin_tuxnew="$y_path_config/tuxnews"
|
||||
|
||||
y_url_control="http://localhost/control"
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Files
|
||||
# -----------------------------------------------------------
|
||||
y_config_Y_Web="$y_path_config/Y-Web.conf"
|
||||
y_config_vnc="$y_path_config/vnc.conf"
|
||||
y_config_nhttpd="$y_path_config/nhttpd.conf"
|
||||
y_config_neutrino="$y_path_config/neutrino.conf"
|
||||
y_upload_file="$y_path_tmp/upload.tmp"
|
||||
y_boot_logo="/var/tuxbox/boot/logo-fb"
|
||||
y_boot_logo_lcd="/var/tuxbox/boot/logo-lcd"
|
||||
y_tmp="$y_path_tmp/y.tmp"
|
||||
y_wait_live="$y_path_httpd/Y_Live_Wait.yhtm"
|
||||
y_tmp_m3u="$y_path_tmp/y.m3u"
|
||||
y_tmp_pls="$y_path_tmp/y.pls"
|
||||
|
||||
|
@@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -----------------------------------------------------------
|
||||
# Y Library (yjogol)
|
||||
# $Date$
|
||||
# $Revision$
|
||||
# -----------------------------------------------------------
|
||||
|
||||
# -----------------------------------------------------------
|
||||
@@ -17,7 +15,6 @@ call_webserver()
|
||||
# ===========================================================
|
||||
# Streaming URL
|
||||
# ===========================================================
|
||||
|
||||
buildLocalIP()
|
||||
{
|
||||
localIP=`ifconfig eth0|sed -n '/inet addr/p'|sed -e 's/^.*inet addr://g' -e 's/ .*//g'`
|
||||
@@ -79,9 +76,10 @@ y_format_message_html()
|
||||
tmp="$tmp <body><div class='work_box'><div class='work_box_head'><div class='work_box_head_h2'>Results</div></div><div class='work_box_body' style='overflow:auto'>"
|
||||
tmp="$tmp <pre>\n$msg\n</pre></div></div></body></html>"
|
||||
|
||||
# tmp="$tmp <body><div class='y_work_box'><pre>\n$msg\n</pre></div></body></html>"
|
||||
#tmp="$tmp <body><div class='y_work_box'><pre>\n$msg\n</pre></div></body></html>"
|
||||
echo -e "$tmp"
|
||||
}
|
||||
|
||||
y_format_message_html2()
|
||||
{
|
||||
tmp="<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>"
|
||||
@@ -92,6 +90,7 @@ y_format_message_html2()
|
||||
tmp="$tmp $msg</div></div></body></html>"
|
||||
echo "$tmp"
|
||||
}
|
||||
|
||||
y_format_message_html_plain()
|
||||
{
|
||||
tmp="<html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>"
|
||||
@@ -106,6 +105,7 @@ y_format_message_html_plain()
|
||||
# (Zeilenformat: VarName=VarValue)
|
||||
# ===========================================================
|
||||
cfg=""
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# config-Datei lesen/cachen (Inhalt in $cfg)
|
||||
# $1=config-Filename
|
||||
@@ -115,14 +115,16 @@ config_open()
|
||||
cfg=""
|
||||
cfg=`cat $1`
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# config-Datei schreiben (Inhalt in $cfg)
|
||||
# $1=config-Filename
|
||||
# -----------------------------------------------------------
|
||||
config_write()
|
||||
{
|
||||
echo "$cfg" >$1
|
||||
echo "$cfg" > $1
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Variablenwert zurueckgeben (vorher open)
|
||||
# $1=VarName
|
||||
@@ -135,6 +137,7 @@ config_get_value()
|
||||
tmp=`echo "$tmp" | $cmd`
|
||||
echo $tmp
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Variablenwert zurueckgeben (ohne open)
|
||||
# $1=config-Filename
|
||||
@@ -145,6 +148,7 @@ config_get_value_direct()
|
||||
config_open $1
|
||||
config_get_value $2
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Variablenwert setzen (vorher open)
|
||||
# $1=VarName)
|
||||
@@ -161,6 +165,7 @@ config_set_value()
|
||||
cfg=`echo "$cfg" | $cmd`
|
||||
fi
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Variablenwert zurueckgeben (ohne open)
|
||||
# $1=config-Filename
|
||||
@@ -173,12 +178,13 @@ config_set_value_direct()
|
||||
config_set_value $2 $3
|
||||
config_write $1
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Reboot
|
||||
# -----------------------------------------------------------
|
||||
yreboot()
|
||||
{
|
||||
# reboot
|
||||
#reboot
|
||||
call_webserver "control/reboot"
|
||||
}
|
||||
|
||||
@@ -206,8 +212,5 @@ check_Y_Web_conf()
|
||||
if ! [ -e $y_config_Y_Web ]
|
||||
then
|
||||
echo "skin=Tuxbox" >$y_config_Y_Web
|
||||
echo "slavebox=" >>$y_config_Y_Web
|
||||
echo "live_resolution_w=384" >>$y_config_Y_Web
|
||||
echo "live_resolution_wh=288" >>$y_config_Y_Web
|
||||
fi
|
||||
}
|
||||
|
@@ -1,89 +0,0 @@
|
||||
#!/bin/sh
|
||||
# -----------------------------------------------------------
|
||||
# API Script (yjogol)
|
||||
# for yWeb independent shell calls
|
||||
# $Date$
|
||||
# $Revision$
|
||||
# -----------------------------------------------------------
|
||||
API_VERSION_MAJOR="1"
|
||||
API_VERSION_MINOR="0"
|
||||
API_VERSION_TEXT="$API_VERSION_MAJOR.$API_VERSION_MINOR"
|
||||
#path_httpd="%(PRIVATE_HTTPDDIR)"
|
||||
path_httpd=".."
|
||||
path_scripts="$path_httpd/scripts"
|
||||
path_bin="/bin"
|
||||
path_varbin="/var/bin"
|
||||
path_sbin="/sbin"
|
||||
path_config="%(CONFIGDIR)"
|
||||
path_tmp="/tmp"
|
||||
|
||||
streaming_client_status="$path_tmp/streaming_client"
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# udp control for neutrinoTV and yWeb LiveTV
|
||||
do_udp_stream()
|
||||
{
|
||||
up="no"
|
||||
if [ -e $path_varbin/udpstreamts ]; then
|
||||
up="$path_varbin/udpstreamts"
|
||||
else
|
||||
if [ -e $path_sbin/udpstreamts ]; then
|
||||
up="$path_sbin/udpstreamts"
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
installed)
|
||||
echo "$up" ;;
|
||||
start)
|
||||
shift 1
|
||||
killall streamts
|
||||
killall udpstreamts
|
||||
echo $* > $streaming_client_status
|
||||
trap "" 1;$up $* &
|
||||
;;
|
||||
stop)
|
||||
killall udpstreamts
|
||||
rm $streaming_client_status
|
||||
echo "ok"
|
||||
;;
|
||||
kill_all_streams)
|
||||
killall streamts
|
||||
killall streampes
|
||||
killall udpstreamts
|
||||
rm $streaming_client_status
|
||||
echo "ok"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
# -----------------------------------------------------------
|
||||
# Main
|
||||
# -----------------------------------------------------------
|
||||
case "$1" in
|
||||
version)
|
||||
echo $API_VERSION_TEXT ;;
|
||||
|
||||
udp_stream)
|
||||
shift 1
|
||||
do_udp_stream $*
|
||||
;;
|
||||
streaming_status)
|
||||
if [ -e $streaming_client_status ]; then
|
||||
cat $streaming_client_status
|
||||
else
|
||||
echo "Streams: "
|
||||
ps | grep stream | grep -v grep | grep -v sh | cut -d " " -f 15
|
||||
fi
|
||||
;;
|
||||
streaming_lock)
|
||||
shift 1
|
||||
echo $* > $streaming_client_status # first parameter should always be the ip of the client
|
||||
echo "ok"
|
||||
;;
|
||||
streaming_unlock)
|
||||
rm $streaming_client_status
|
||||
echo "ok"
|
||||
;;
|
||||
*)
|
||||
echo "[api.sh] Parameter wrong: $*" ;;
|
||||
esac
|
Reference in New Issue
Block a user