diff --git a/src/nhttpd/web/extentions/hddtools/files/httpd/Y_Ext_hddtools.yhtm b/src/nhttpd/web/extentions/hddtools/files/httpd/Y_Ext_hddtools.yhtm new file mode 100755 index 000000000..d068e202c --- /dev/null +++ b/src/nhttpd/web/extentions/hddtools/files/httpd/Y_Ext_hddtools.yhtm @@ -0,0 +1,45 @@ +{=include-block:Y_Blocks.txt;head=} + + + + + +
+
+
{=var-set:help_url=Help-Extensions-hddtools=}{=var-set:menu=HDD Tools [1.0.1]=}{=include-block:Y_Blocks.txt;work_menu=}
+
+
+ + + + + + +
IDE Information
+ + + + + + + +
Commands
+ +
+
+
+
+
+ + + diff --git a/src/nhttpd/web/extentions/hddtools/files/httpd/scripts/Y_Ext_hddtools.sh b/src/nhttpd/web/extentions/hddtools/files/httpd/scripts/Y_Ext_hddtools.sh new file mode 100755 index 000000000..ee8003009 --- /dev/null +++ b/src/nhttpd/web/extentions/hddtools/files/httpd/scripts/Y_Ext_hddtools.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# ----------------------------------------------------------- +# HDD (yjogol) +# $Date: 2007-12-29 10:11:37 $ +# $Revision: 1.1 $ +# ----------------------------------------------------------- + +# ----------------------------------------------------------- +hdd_proc1="/proc/ide/ide0/hda" +hdd_model1="$hdd_proc1/model" +hdd_settings1="$hdd_proc1/settings" +disc1="/dev/ide/host0/bus0/target0/lun0/disc" +# ----------------------------------------------------------- +y_format_message_html() +{ + tmp="" + tmp="$tmp " + tmp="$tmp
Results
" + tmp="$tmp
\n$msg\n
" + +# tmp="$tmp
\n$msg\n
" + echo -e "$tmp" +} +# ----------------------------------------------------------- +# Main +# ----------------------------------------------------------- +case "$1" in + hdd_proc) + msg=`cat $hdd_proc1/$2` + msg="$3

$msg" + y_format_message_html + ;; + + hdd_sleep) + msg=`hdparm -Y $disc1` + msg="Sleep

$msg" + y_format_message_html + ;; + + hdd_hdparm) + msg=`hdparm $2 $disc1` + msg="$3

$msg" + y_format_message_html + ;; + *) + echo "[Y_HDD.sh] Parameter falsch: $*" ;; +esac + + + diff --git a/src/nhttpd/web/extentions/hddtools/hddtools_uninstall.inc b/src/nhttpd/web/extentions/hddtools/hddtools_uninstall.inc new file mode 100644 index 000000000..955bfea04 --- /dev/null +++ b/src/nhttpd/web/extentions/hddtools/hddtools_uninstall.inc @@ -0,0 +1,20 @@ +# =========================================================== +# yWeb SDK: Extention Unnstaller Include +# Extention Name: hddtools +# by yjogol +# ----------------------------------------------------------- +# $Date: 2007-12-29 10:11:37 $ +# $Revision: 1.1 $ +# =========================================================== + +yI_updatename="yWeb-Extension hddtools (08.01.2008)" +yI_Ext_Tag="hddtools" +yI_Ext_Version="1-0-1" +yI_uninstall_log="$y_path_tmp/uninstall_hddtools.log" +yI_uninstaller="hddtools_uninstall.inc" + +uninstall() +{ + rm $y_ywebover_dir/Y_Ext_hddtools.yhtm + rm $y_ywebover_dir/scripts/Y_Ext_hddtools.sh +} diff --git a/src/nhttpd/web/extentions/hddtools/install.inc b/src/nhttpd/web/extentions/hddtools/install.inc new file mode 100644 index 000000000..cbeaf78b1 --- /dev/null +++ b/src/nhttpd/web/extentions/hddtools/install.inc @@ -0,0 +1,20 @@ +# =========================================================== +# yWeb SDK: Extention Installer Include +# Extention Name: boxinfo +# by yjogol +# ----------------------------------------------------------- +# $Date: 2007-12-29 10:11:37 $ +# $Revision: 1.1 $ +# =========================================================== + +yI_updatename="yWeb-Extension hddtools (08.01.2008)" +yI_Ext_Tag="hddtools" +yI_Ext_Version="1-0-1" +yI_install_log="$y_path_tmp/install_hddtools.log" +yI_uninstaller="hddtools_uninstall.sh" + +install() +{ + cp -r /tmp/files/httpd/* $y_ywebover_dir + chmod 755 $y_ywebover_dir/scripts/*.sh +} diff --git a/src/nhttpd/web/extentions/hddtools/install.sh b/src/nhttpd/web/extentions/hddtools/install.sh new file mode 100755 index 000000000..2ce6a4f0e --- /dev/null +++ b/src/nhttpd/web/extentions/hddtools/install.sh @@ -0,0 +1,143 @@ +# =========================================================== +# yWeb Extension: Install an Extension +# by yjogol +# ----------------------------------------------------------- +# $Date: 2007-12-29 10:11:37 $ +# $Revision: 1.3 $ +# ----------------------------------------------------------- +# Script starts in /tmp +# =========================================================== + +# ----------------------------------------------------------- +# Installer Configs +# ----------------------------------------------------------- +yI_Version="$Revision: 1.3 $" + +# ----------------------------------------------------------- +# Dirs +# ----------------------------------------------------------- +y_path_usrbin="/var/bin" +y_path_config="/var/tuxbox/config" +y_path_tmp="/tmp" +y_ywebover_dir="/var/httpd" +y_ext_conf_dir="$y_path_config/ext" + +# ----------------------------------------------------------- +# Files +# ----------------------------------------------------------- +y_config_Y_Web="$y_path_config/Y-Web.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" + +# =========================================================== +# config-Dateien - lesen / schreiben +# (Zeilenformat: VarName=VarValue) +# =========================================================== +cfg="" +# ----------------------------------------------------------- +# config-Datei lesen/cachen (Inhalt in $cfg) +# $1=config-Filename +# ----------------------------------------------------------- +config_open() +{ + cfg="" + cfg=`cat $1` +} +# ----------------------------------------------------------- +# config-Datei schreiben (Inhalt in $cfg) +# $1=config-Filename +# ----------------------------------------------------------- +config_write() +{ + echo "$cfg" >$1 +} +# ----------------------------------------------------------- +# Variablenwert zurueckgeben (vorher open) +# $1=VarName +# ----------------------------------------------------------- +config_get_value() +{ + cmd="sed -n /^$1=/p" + tmp=`echo "$cfg" | $cmd` + cmd="sed -e s/^$1=//1" + tmp=`echo "$tmp" | $cmd` + echo $tmp +} +# ----------------------------------------------------------- +# Variablenwert zurueckgeben (ohne open) +# $1=config-Filename +# $2=VarName +# ----------------------------------------------------------- +config_get_value_direct() +{ + config_open $1 + config_get_value $2 +} +# ----------------------------------------------------------- +# Variablenwert setzen (vorher open) +# $1=VarName) +# $2=VarValue +# ----------------------------------------------------------- +config_set_value() +{ + tmp=`echo "$cfg" | sed -n "/^$1=.*/p"` + if [ "$tmp" = "" ] + then + cfg=`echo -e "$cfg\n$1=$2"` + else + cmd="sed -e s/^$1=.*/$1=$2/g" + cfg=`echo "$cfg" | $cmd` + fi +} +# ----------------------------------------------------------- +# Variablenwert zurueckgeben (ohne open) +# $1=config-Filename +# $2=VarName) +# $3=VarValue +# ----------------------------------------------------------- +config_set_value_direct() +{ + config_open $1 + config_set_value $2 $3 + config_write $1 +} + +# =========================================================== +# Initialization +# =========================================================== +. ./install.inc +hp=`config_get_value_direct "$y_config_nhttpd" "WebsiteMain.override_directory"` +if [ "$hp" != "" ]; then + y_ywebover_dir=`echo "$hp"` +fi +mkdir -p $y_ywebover_dir +chmod -R oug+rw $y_ywebover_dir + +# ----------------------------------------------------------- +# prepare log +# ----------------------------------------------------------- +date +%y%m%d_%H%M%S >"$yI_install_log" +echo "" >>yI_install_log +echo "installing $yI_updatename [$yI_Ext_Tag/$yI_Ext_Version]" >>"yI_install_log" +echo "installdir: $y_ywebover_dir" + +# ----------------------------------------------------------- +# Install (from install.inc) +# ----------------------------------------------------------- +install + +# ----------------------------------------------------------- +# finishing +# ----------------------------------------------------------- +mkdir -p $y_ext_conf_dir +chmod oug+rw $y_ext_conf_dir +chmod 755 ./uninstall* +cp ./uninstall.sh "$y_ext_conf_dir/" +cp ./*uninstall.inc "$y_ext_conf_dir/" + +# ----------------------------------------------------------- +# Clean Up +# ----------------------------------------------------------- +cd /tmp +rm -r /tmp/files diff --git a/src/nhttpd/web/extentions/hddtools/uninstall.sh b/src/nhttpd/web/extentions/hddtools/uninstall.sh new file mode 100755 index 000000000..ec83bbc95 --- /dev/null +++ b/src/nhttpd/web/extentions/hddtools/uninstall.sh @@ -0,0 +1,136 @@ +# =========================================================== +# yWeb Extension: Unnstall an Extension +# by yjogol +# ----------------------------------------------------------- +# $Date: 2007-12-29 17:08:16 $ +# $Revision: 1.4 $ +# ----------------------------------------------------------- +# Script starts in /tmp +# =========================================================== + +# ----------------------------------------------------------- +# Installer Configs +# ----------------------------------------------------------- +yI_Version="$Revision: 1.4 $" + +# ----------------------------------------------------------- +# Dirs +# ----------------------------------------------------------- +y_path_usrbin="/var/bin" +y_path_config="/var/tuxbox/config" +y_path_tmp="/tmp" +y_ywebover_dir="/var/httpd" +y_ext_conf_dir="$y_path_config/ext" + +# ----------------------------------------------------------- +# Files +# ----------------------------------------------------------- +y_config_Y_Web="$y_path_config/Y-Web.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" + +# =========================================================== +# config-Dateien - lesen / schreiben +# (Zeilenformat: VarName=VarValue) +# =========================================================== +cfg="" +# ----------------------------------------------------------- +# config-Datei lesen/cachen (Inhalt in $cfg) +# $1=config-Filename +# ----------------------------------------------------------- +config_open() +{ + cfg="" + cfg=`cat $1` +} +# ----------------------------------------------------------- +# config-Datei schreiben (Inhalt in $cfg) +# $1=config-Filename +# ----------------------------------------------------------- +config_write() +{ + echo "$cfg" >$1 +} +# ----------------------------------------------------------- +# Variablenwert zurueckgeben (vorher open) +# $1=VarName +# ----------------------------------------------------------- +config_get_value() +{ + cmd="sed -n /^$1=/p" + tmp=`echo "$cfg" | $cmd` + cmd="sed -e s/^$1=//1" + tmp=`echo "$tmp" | $cmd` + echo $tmp +} +# ----------------------------------------------------------- +# Variablenwert zurueckgeben (ohne open) +# $1=config-Filename +# $2=VarName +# ----------------------------------------------------------- +config_get_value_direct() +{ + config_open $1 + config_get_value $2 +} +# ----------------------------------------------------------- +# Variablenwert setzen (vorher open) +# $1=VarName) +# $2=VarValue +# ----------------------------------------------------------- +config_set_value() +{ + tmp=`echo "$cfg" | sed -n "/^$1=.*/p"` + if [ "$tmp" = "" ] + then + cfg=`echo -e "$cfg\n$1=$2"` + else + cmd="sed -e s/^$1=.*/$1=$2/g" + cfg=`echo "$cfg" | $cmd` + fi +} +# ----------------------------------------------------------- +# Variablenwert zurueckgeben (ohne open) +# $1=config-Filename +# $2=VarName) +# $3=VarValue +# ----------------------------------------------------------- +config_set_value_direct() +{ + config_open $1 + config_set_value $2 $3 + config_write $1 +} + +# =========================================================== +# Initialization +# =========================================================== +. $y_ext_conf_dir/$1 +hp=`config_get_value_direct "$y_config_nhttpd" "WebsiteMain.override_directory"` +if [ "$hp" != "" ]; then + y_ywebover_dir=`echo "$hp"` +fi +mkdir -p $y_ywebover_dir + +# ----------------------------------------------------------- +# prepare log +# ----------------------------------------------------------- +date +%y%m%d_%H%M%S >"$yI_uninstall_log" +echo "" >>"$yI_uninstall_log" +echo "uninstalling $yI_updatename [$yI_Ext_Tag/$yI_Ext_Version]" >>"$yI_uninstall_log" +#echo "installdir: $y_ywebover_dir" + +# ----------------------------------------------------------- +# Uninstall (from uninstal_.inc) +# ----------------------------------------------------------- +uninstall + +# ----------------------------------------------------------- +# finishing +# ----------------------------------------------------------- +rm $y_ext_conf_dir/$1 + +# ----------------------------------------------------------- +# Clean Up +# -----------------------------------------------------------