wok-tiny rev 11
Add manager
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 02 13:43:52 2011 +0100 (2011-02-02) |
parents | 9f3b17cfbfe1 |
children | a82306dc8fef |
files | gpxe/receipt manager-fr/receipt manager-fr/stuff/var/www/adm/index.sh manager-fr/stuff/var/www/index.sh manager/receipt manager/stuff/var/www/E404.html manager/stuff/var/www/adm/index.sh manager/stuff/var/www/css/favicon.ico manager/stuff/var/www/css/pics/website/header.png manager/stuff/var/www/css/pics/website/logo.png manager/stuff/var/www/css/slitaz.css manager/stuff/var/www/index.sh |
line diff
1.1 --- a/gpxe/receipt Wed Feb 02 11:52:48 2011 +0100 1.2 +++ b/gpxe/receipt Wed Feb 02 13:43:52 2011 +0100 1.3 @@ -2,7 +2,7 @@ 1.4 1.5 PACKAGE="gpxe" 1.6 VERSION="0.9.3" 1.7 -CATEGORY="tiny-slitaz" 1.8 +CATEGORY="network" 1.9 SHORT_DESC="Forward PXE to Slitaz Web Boot" 1.10 MAINTAINER="pascal.bellard@slitaz.org" 1.11 WEB_SITE="http://boot.slitaz.org/" 1.12 @@ -33,7 +33,7 @@ 1.13 post_install() 1.14 { 1.15 [ -n "$URLS" ] && \ 1.16 - echo "$URLS" | dostounix | sed 's/$/,/' | cat - /dev/null | \ 1.17 + echo "$URLS" | dos2unix | sed 's/$/,/' | cat - /dev/null | \ 1.18 dd of=$1/usr/share/boot/gpxe.pxe bs=1 seek=5 count=256 2> /dev/null 1.19 grep -q inetd $1/etc/rcS.conf || 1.20 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/manager-fr/receipt Wed Feb 02 13:43:52 2011 +0100 2.3 @@ -0,0 +1,15 @@ 2.4 +# SliTaz package receipt. 2.5 + 2.6 +PACKAGE="manager-fr" 2.7 +VERSION="1.0" 2.8 +CATEGORY="network" 2.9 +SHORT_DESC="Tiny SliTaz Web Manager in french language" 2.10 +MAINTAINER="pascal.bellard@slitaz.org" 2.11 +WEB_SITE="http://mirror.slitaz.org/pizza/tiny/" 2.12 +DEPENDS="manager" 2.13 + 2.14 +# Rules to gen a SliTaz package suitable for Tazpkg. 2.15 +genpkg_rules() 2.16 +{ 2.17 + cp -a stuff/. $fs 2.18 +}
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/manager-fr/stuff/var/www/adm/index.sh Wed Feb 02 13:43:52 2011 +0100 3.3 @@ -0,0 +1,52 @@ 3.4 +#!/bin/sh 3.5 + 3.6 +. /usr/bin/httpd_helper.sh 3.7 + 3.8 +command="$GET__NAMES" 3.9 +case "$command" in 3.10 +start|restart|stop) command="/etc/init.d/$(GET $command) $command";; 3.11 +esac 3.12 +cat <<EOT 3.13 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 3.14 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3.15 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> 3.16 +<head> 3.17 + <title>status tiny server $(hostname) - $HTTP_HOST 3.18 + </title> 3.19 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 3.20 + <meta HTTP-EQUIV="Refresh" CONTENT="5;URL=/index.sh"> 3.21 + <meta name="description" content="Tiny server manager" /> 3.22 + <meta name="expires" content="never" /> 3.23 + <meta name="modified" content="2008-03-05 16:33:00" /> 3.24 + <link rel="shortcut icon" href="/css/favicon.ico" /> 3.25 + <link rel="stylesheet" type="text/css" href="/css/slitaz.css" /> 3.26 +</head> 3.27 +<body bgcolor="#ffffff"> 3.28 +<div id="header"> 3.29 + <a href="http://www.slitaz.org/"><img id="logo" 3.30 + src="/css/pics/website/logo.png" title="www.slitaz.org" 3.31 + alt="www.slitaz.org" 3.32 + style="border: 0px solid ; width: 200px; height: 74px;" /></a> 3.33 + <p id="titre">#!/tinyserver/command</p> 3.34 +</div> 3.35 +<div id="content"> 3.36 +<h4>$(date "+%d/%m/%Y %H:%M")</h4> 3.37 +<h2>$command</h2> 3.38 +<pre> 3.39 +$($command) 3.40 +</pre> 3.41 +<h4>Commande terminée</h4> 3.42 +</div> 3.43 +<!-- Start of footer and copy notice --> 3.44 +<div id="copy"> 3.45 +<p> 3.46 +Copyright © $(date +%Y) <a href="http://www.slitaz.org/">SliTaz</a> - 3.47 + 3.48 +<a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> 3.49 +</p> 3.50 +<!-- End of copy --> 3.51 +</div> 3.52 + 3.53 +</body> 3.54 +</html> 3.55 +EOT
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/manager-fr/stuff/var/www/index.sh Wed Feb 02 13:43:52 2011 +0100 4.3 @@ -0,0 +1,223 @@ 4.4 +#!/bin/sh 4.5 + 4.6 +. /usr/bin/httpd_helper.sh 4.7 + 4.8 +cpu() 4.9 +{ 4.10 +grep '^model name' /proc/cpuinfo | head -n 1 | \ 4.11 +sed -e 's/.*Intel(R) //' -e 's/.*AMD //' -e 's/.*: //' \ 4.12 + -e 's/@//' -e 's/(R)//' -e 's/(TM)//' -e 's/CPU //' -e 's/Processor //' 4.13 +} 4.14 + 4.15 +cat <<EOT 4.16 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4.17 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4.18 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> 4.19 +<head> 4.20 + <title>status tiny server $(hostname) - $HTTP_HOST 4.21 + </title> 4.22 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 4.23 + <meta name="description" content="Tiny server manager" /> 4.24 + <meta name="expires" content="never" /> 4.25 + <meta name="modified" content="2008-03-05 16:33:00" /> 4.26 + <link rel="shortcut icon" href="css/favicon.ico" /> 4.27 + <link rel="stylesheet" type="text/css" href="css/slitaz.css" /> 4.28 +</head> 4.29 +<body bgcolor="#ffffff"> 4.30 +<div id="header"> 4.31 + <a name="top"></a> 4.32 +<!-- Access --> 4.33 +<div id="access"> 4.34 +$([ -d /var/www/wiki ] && echo "<a href="/wiki/index.sh" title="Wiki">Wiki</a> |") 4.35 +$([ -n "$GET__NAMES" ] && echo "<a href="$SCRIPT_NAME" title="Status">Status</a> |") 4.36 + <a href="adm/index.sh?/sbin/poweroff" title="Poweroff">Eteindre</a> | 4.37 + <a href="adm/index.sh?/sbin/reboot" title="Reboot">Redémarrer</a> 4.38 +</div> 4.39 + <a href="http://www.slitaz.org/"><img id="logo" 4.40 + src="css/pics/website/logo.png" title="www.slitaz.org" 4.41 + alt="www.slitaz.org" 4.42 + style="border: 0px solid ; width: 200px; height: 74px;" /></a> 4.43 + <p id="titre">#!/tinyserver/status</p> 4.44 + 4.45 +</div> 4.46 +<!-- Navigation menu --> 4.47 +<div id="nav"> 4.48 + 4.49 +<div class="nav_box"> 4.50 +<h4>Services</h4> 4.51 + 4.52 +<!-- Start content --> 4.53 +<table> 4.54 +EOT 4.55 + 4.56 +for svr in $( . ../../etc/rcS.conf ; cd /usr/sbin ; ls pppd 2> /dev/null ; echo $RUN_DAEMONS | sed 's/ /\n/g' | sort) ; do 4.57 + status="<td>$svr</td><td><a href=\"adm/index.sh?stop=$svr\">stop</a></td><td><a href=\"adm/index.sh?restart=$svr\">restart</a></td>" 4.58 + grep -vs ^\# /etc/inetd.conf | grep -q $(which $svr) && 4.59 + [ -n "$(ps | grep -v grep | grep /usr/sbin/inetd)" ] || 4.60 + [ -n "$(ps | grep -v grep | grep $(which $svr) )" ] || 4.61 + status="<td><strike>$svr</strike></td><td><a href=\"adm/index.sh?start=$svr\">start</a></td><td></td>" 4.62 + case "$svr" in 4.63 + pppd) info="<td><a href=\"$SCRIPT_NAME?show=/etc/ppp/scripts/ppp-on,/etc/ppp/scripts/ppp-on-dialer,/etc/ppp/options\">scripts</a></td>";; 4.64 + tftpd) info="<td><a href=\"$SCRIPT_NAME?list=/boot\">files</a></td>";; 4.65 + ftpd) info="<td><a href=\"$SCRIPT_NAME?list=/var/ftp\">files</a></td>";; 4.66 + udhcpd) info="<td><a href=\"$SCRIPT_NAME?leases\">leases</a></td>";; 4.67 + httpd) info="<td><a href=\"$SCRIPT_NAME?httpinfo\">info</a></td>";; 4.68 + *) info="<td></td>";; 4.69 + esac 4.70 + echo -e " <tr>\n $status$info\n </tr>" 4.71 +done 4.72 +cat <<EOT 4.73 +</table> 4.74 +</div> 4.75 + 4.76 +<div class="nav_box"> 4.77 +<h4>Log files</h4> 4.78 +<table> 4.79 +EOT 4.80 +for i in $(ls /var/log); do 4.81 + case "$i" in 4.82 + boot-time|wtmp) continue;; 4.83 + esac 4.84 + cat <<EOT 4.85 +<tr> 4.86 +<td><a href="$SCRIPT_NAME?show=/var/log/$i" title="Show file /var/log/$i"> 4.87 +$i</a></td><td>$(du -h /var/log/$i | cut -f1)</td> 4.88 +</tr> 4.89 +EOT 4.90 +done 4.91 +cat <<EOT 4.92 +</table> 4.93 +</div> 4.94 + 4.95 +<div class="nav_box"> 4.96 +<h4>Fichiers de configuration</h4> 4.97 +<table> 4.98 +EOT 4.99 +for i in $(cd /etc ; ls *.conf); do 4.100 + cat <<EOT 4.101 +<tr> 4.102 +<td><a href="$SCRIPT_NAME?show=/etc/$i" title="Afficher le fichier /etc/$i"> 4.103 +$i</a></td><td>$(du -h /etc/$i | cut -f1)</td> 4.104 +</tr> 4.105 +EOT 4.106 +done 4.107 +cat <<EOT 4.108 +</table> 4.109 +</div> 4.110 + 4.111 +</div> 4.112 + 4.113 +<div id="content"> 4.114 +<h4>$(date) - $(hostname) - $(cpu) - $HTTP_HOST</h4> 4.115 +EOT 4.116 +case "$GET__NAMES" in 4.117 +show) for i in $(GET show | sed 's/,/ /g'); do 4.118 + cat <<EOT 4.119 +<h2>File $i</h2> 4.120 +<pre> 4.121 +EOT 4.122 + case "$i" in 4.123 + /etc/ppp*) cat $i ;; 4.124 + *) su -c "cat $i" tux ;; 4.125 + esac 4.126 + cat <<EOT 4.127 +</pre> 4.128 +EOT 4.129 + done 4.130 + ;; 4.131 +list) cat <<EOT 4.132 +<h2>Files in $(GET list)</h2> 4.133 +<pre> 4.134 +$( su -c "cd $(GET list) && find * | xargs ls -ld" tux ) 4.135 +</pre> 4.136 +EOT 4.137 + ;; 4.138 +leases) cat <<EOT 4.139 +<h2>Baux DHCP</h2> 4.140 +<pre> 4.141 +$(cat /var/lib/misc/udhcpd.leases) 4.142 +</pre> 4.143 +EOT 4.144 + ;; 4.145 +httpinfo) cat <<EOT 4.146 +<h2>Infos HTTP</h2> 4.147 +<pre> 4.148 +$(httpinfo) 4.149 +</pre> 4.150 +EOT 4.151 + ;; 4.152 +*) cat <<EOT 4.153 +<a name="disk"></a> 4.154 +<h2>Utilisation des disques</h2> 4.155 +<pre> 4.156 +$(df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)') 4.157 +</pre> 4.158 +<a name="network"></a> 4.159 +<h2>Réseau</h2> 4.160 +<h3>Interfaces</h3> 4.161 +<pre> 4.162 +$(ifconfig) 4.163 +</pre> 4.164 +<h3>Table de routage</h3> 4.165 +<pre> 4.166 +$(route) 4.167 +</pre> 4.168 +<h3>Connexions</h3> 4.169 +<pre> 4.170 +$(netstat -ap) 4.171 +</pre> 4.172 +EOT 4.173 + [ -f /proc/net/ip_conntrack ] && cat <<EOT 4.174 +<h3>Connexions actives</h3> 4.175 +<pre> 4.176 +$(cat /proc/net/ip_conntrack) 4.177 +</pre> 4.178 +EOT 4.179 + cat <<EOT 4.180 +<h3>Table ARP</h3> 4.181 +<pre> 4.182 +$(arp) 4.183 +</pre> 4.184 +<a name="processes"></a> 4.185 +<h2>Processus</h2> 4.186 +<h3>Memory</h3> 4.187 +<pre> 4.188 +$(free) 4.189 +</pre> 4.190 +<h3>Liste des processus</h3> 4.191 +<pre> 4.192 +Uptime $(uptime | sed 's/^\s*//') 4.193 +</pre> 4.194 +<pre> 4.195 +$(top -n1 -b) 4.196 +</pre> 4.197 +<a name="boot"></a> 4.198 +<h2>Arguments de lancement</h2> 4.199 +<pre> 4.200 +$(cat /proc/cmdline) 4.201 +</pre> 4.202 +<a name="Utilisateurs"></a> 4.203 +<h2>Users</h2> 4.204 +<pre> 4.205 +$(last) 4.206 +</pre> 4.207 +EOT 4.208 + ;; 4.209 +esac 4.210 + 4.211 +cat <<EOT 4.212 +</div> 4.213 +<!-- End content --> 4.214 +<!-- Start of footer and copy notice --> 4.215 +<div id="copy"> 4.216 +<p> 4.217 +Copyright © $(date +%Y) <a href="http://www.slitaz.org/">SliTaz</a> - 4.218 + 4.219 +<a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> 4.220 +</p> 4.221 +<!-- End of copy --> 4.222 +</div> 4.223 + 4.224 +</body> 4.225 +</html> 4.226 +EOT
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/manager/receipt Wed Feb 02 13:43:52 2011 +0100 5.3 @@ -0,0 +1,62 @@ 5.4 +# SliTaz package receipt. 5.5 + 5.6 +PACKAGE="manager" 5.7 +VERSION="1.0" 5.8 +CATEGORY="network" 5.9 +SHORT_DESC="Tiny SliTaz Web Manager" 5.10 +MAINTAINER="pascal.bellard@slitaz.org" 5.11 +WEB_SITE="http://mirror.slitaz.org/pizza/tiny/" 5.12 +CONFIG_FILES="/etc/httpd.conf" 5.13 +DEPENDS="base-tiny" 5.14 +CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf" 5.15 + 5.16 +# Rules to gen a SliTaz package suitable for Tazpkg. 5.17 +genpkg_rules() 5.18 +{ 5.19 + cp -a stuff/. $fs 5.20 +} 5.21 + 5.22 +post_install() 5.23 +{ 5.24 + grep -q httpd $1/etc/rcS.conf || 5.25 + sed -i 's/^RUN_DAEMONS="/&httpd /' $1/etc/rcS.conf 5.26 + grep -q HTTPD_OPTIONS $1/etc/daemons.conf || 5.27 + cat >> $1/etc/daemons.conf <<EOT 5.28 + 5.29 +# Http daemon options. 5.30 +HTTPD_OPTIONS="-u 0:0" 5.31 +EOT 5.32 + while read line comment ; do 5.33 + grep -qs "^$line" $1/etc/httpd.conf && continue 5.34 + echo "$line $comment" >> $1/etc/httpd.conf 5.35 + done <<EOT 5.36 +H:/var/www # define the server root. 5.37 +I:index.sh # Show index.html when a directory is requested 5.38 +*.sh:/bin/sh # run xxx.sh through an interpreter 5.39 +A:127.0.0.1 # Allow local loopback connections 5.40 +$( . $1/etc/network.conf 5.41 +while [ -n "$IP" ]; do 5.42 + echo "A:$IP/$NETMASK # Allow address from $IP/$NETMASK" 5.43 + IP="$LAN_IP" ; NETMASK="$LAN_NETMASK" ; LAN_IP="" 5.44 +done ) 5.45 +D:* # Deny from other IP connections 5.46 +/adm:admin:$MANAGER_PASSWORD # Require user admin, pwd setup on urls starting with /adm/ 5.47 +EOT 5.48 + grep -qs "^E404:" $1/etc/httpd.conf || cat >> $1/etc/httpd.conf <<EOT 5.49 +E404:/var/www/E404.html # the 404 (not found) error page 5.50 +EOT 5.51 +} 5.52 + 5.53 +config_form() 5.54 +{ 5.55 + [ -n "$MANAGER_PASSWORD" ] || MANAGER_PASSWORD=setup 5.56 + cat <<EOT 5.57 +<table> 5.58 +<tr> 5.59 +<td>Admin password ( for http://the-tiny-server/adm/ )</td> 5.60 +<td><input type="text" name="MANAGER_PASSWORD" value="$MANAGER_PASSWORD" /></td> 5.61 +</tr> 5.62 +</table> 5.63 +EOT 5.64 +} 5.65 +
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/manager/stuff/var/www/E404.html Wed Feb 02 13:43:52 2011 +0100 6.3 @@ -0,0 +1,5 @@ 6.4 +<html> 6.5 +<head> 6.6 +<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=/"> 6.7 +</head> 6.8 +</html>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/manager/stuff/var/www/adm/index.sh Wed Feb 02 13:43:52 2011 +0100 7.3 @@ -0,0 +1,52 @@ 7.4 +#!/bin/sh 7.5 + 7.6 +. /usr/bin/httpd_helper.sh 7.7 + 7.8 +command="$GET__NAMES" 7.9 +case "$command" in 7.10 +start|restart|stop) command="/etc/init.d/$(GET $command) $command";; 7.11 +esac 7.12 +cat <<EOT 7.13 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 7.14 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 7.15 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> 7.16 +<head> 7.17 + <title>status tiny server $(hostname) - $HTTP_HOST 7.18 + </title> 7.19 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 7.20 + <meta HTTP-EQUIV="Refresh" CONTENT="5;URL=/index.sh"> 7.21 + <meta name="description" content="Tiny server manager" /> 7.22 + <meta name="expires" content="never" /> 7.23 + <meta name="modified" content="2008-03-05 16:33:00" /> 7.24 + <link rel="shortcut icon" href="/css/favicon.ico" /> 7.25 + <link rel="stylesheet" type="text/css" href="/css/slitaz.css" /> 7.26 +</head> 7.27 +<body bgcolor="#ffffff"> 7.28 +<div id="header"> 7.29 + <a href="http://www.slitaz.org/"><img id="logo" 7.30 + src="/css/pics/website/logo.png" title="www.slitaz.org" 7.31 + alt="www.slitaz.org" 7.32 + style="border: 0px solid ; width: 200px; height: 74px;" /></a> 7.33 + <p id="titre">#!/tinyserver/command</p> 7.34 +</div> 7.35 +<div id="content"> 7.36 +<h4>$(date)</h4> 7.37 +<h2>$command</h2> 7.38 +<pre> 7.39 +$($command) 7.40 +</pre> 7.41 +<h4>Command complete</h4> 7.42 +</div> 7.43 +<!-- Start of footer and copy notice --> 7.44 +<div id="copy"> 7.45 +<p> 7.46 +Copyright © $(date +%Y) <a href="http://www.slitaz.org/">SliTaz</a> - 7.47 + 7.48 +<a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> 7.49 +</p> 7.50 +<!-- End of copy --> 7.51 +</div> 7.52 + 7.53 +</body> 7.54 +</html> 7.55 +EOT
8.1 Binary file manager/stuff/var/www/css/favicon.ico has changed
9.1 Binary file manager/stuff/var/www/css/pics/website/header.png has changed
10.1 Binary file manager/stuff/var/www/css/pics/website/logo.png has changed
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/manager/stuff/var/www/css/slitaz.css Wed Feb 02 13:43:52 2011 +0100 11.3 @@ -0,0 +1,381 @@ 11.4 +/* 11.5 + CSS style for SliTaz GNU/Linux website 11.6 + www.slitaz.org - (c) 2007 Pankso 11.7 +*/ 11.8 + 11.9 +html { 11.10 + height: 102%; 11.11 +} 11.12 + 11.13 +body { 11.14 + background: #ffffff; 11.15 + color: black; 11.16 + font: 13px sans-serif, vernada, arial; 11.17 + margin: 0; 11.18 +} 11.19 + 11.20 +/* Accessibility */ 11.21 + 11.22 +#access { 11.23 + position: absolute; 11.24 + top: 4px; 11.25 + right: 4px; 11.26 + text-align: right; 11.27 + width: 100%; 11.28 + margin: 0; 11.29 + font-size: 11px; 11.30 + font-weight: bold; 11.31 +} 11.32 + 11.33 +#access a { 11.34 + background: inherit; 11.35 + color: white; 11.36 + text-decoration: none; 11.37 +} 11.38 + 11.39 +#access a:hover { 11.40 + background: inherit; 11.41 + color: #222222; 11.42 +} 11.43 + 11.44 +/* Header and title */ 11.45 + 11.46 +#header{ 11.47 + background: #f0ba08 url(pics/website/header.png) repeat-x top; 11.48 + color: black; 11.49 + width: 100%; 11.50 + height: 50px; 11.51 + border-top: 1px solid black; 11.52 + border-bottom: 1px solid black; 11.53 + margin-bottom: 30px; 11.54 +} 11.55 + 11.56 +#titre { 11.57 + position: absolute; 11.58 + font-size: 16px; 11.59 + font-weight: bolder ; 11.60 + margin-left: 200px; 11.61 + margin-top: 28px; 11.62 +} 11.63 + 11.64 +#logo { 11.65 + position: absolute; 11.66 + float: left; 11.67 + margin-left: 16px; 11.68 + margin-top: 0px; 11.69 +} 11.70 + 11.71 +/* Navigation */ 11.72 + 11.73 +#nav { 11.74 + position: absolute; 11.75 + top: 76px; 11.76 + right: 40px; 11.77 + color: #555555; 11.78 + float: right; 11.79 + width: 250px; 11.80 + line-height: 1.5em; 11.81 + text-align: left; 11.82 + font-size: 12px; 11.83 +} 11.84 + 11.85 +#nav ul { 11.86 + -moz-border-radius: 8px; 11.87 + -webkit-border-radius: 8px; 11.88 + list-style-type: none; 11.89 + margin: 10px 0; 11.90 + padding: 10px 24px 10px 24px; 11.91 + background-color: #eaeaea; 11.92 +} 11.93 + 11.94 +#nav .nav_box ul { 11.95 + list-style-type: none; 11.96 + margin: 0; 11.97 + padding: 10px 24px 10px 0px; 11.98 +} 11.99 + 11.100 +#nav li { 11.101 + display: inline; 11.102 +} 11.103 + 11.104 +#nav h4 { 11.105 + font-size: 110%; 11.106 + color: #666666; 11.107 + font-weight: bold; 11.108 + margin: 0; 11.109 + padding: 0 0 1px 0; 11.110 + border-bottom: 1px solid #cecece; 11.111 +} 11.112 + 11.113 +#nav a { 11.114 + color: #0F314E; 11.115 + background: inherit; 11.116 + display: block; 11.117 + text-decoration: none; 11.118 + font-weight: bold; 11.119 +} 11.120 + 11.121 +#nav a:hover { 11.122 + color: #DF8F06; 11.123 + text-decoration: none; 11.124 + display: block; 11.125 +} 11.126 + 11.127 +#nav hr { 11.128 + margin: 2px 0px 1px 0px; 11.129 + border: 0px; 11.130 + border-top: 1px solid #BDBDBD; 11.131 + 11.132 +} 11.133 + 11.134 +.nav_box { 11.135 + -moz-border-radius: 8px; 11.136 + -webkit-border-radius: 8px; 11.137 + margin: 10px 0; 11.138 + padding: 10px 24px 10px 24px; 11.139 + background-color: #eaeaea; 11.140 + text-align: justify; 11.141 +} 11.142 + 11.143 +#nav .nav_box p { 11.144 + line-height: 1.3em; 11.145 +} 11.146 + 11.147 +#nav .nav_box p a { 11.148 + display: inline; 11.149 + font-weight: normal; 11.150 + text-decoration: underline; 11.151 +} 11.152 + 11.153 +#nav .nav_box p a:hover { 11.154 + text-decoration: none; 11.155 + color: blue; 11.156 + background: inherit; 11.157 +} 11.158 + 11.159 +#nav hr { 11.160 + height: 0px; 11.161 + border: 0px solid #eaeaea; 11.162 +} 11.163 + 11.164 +/* Page content */ 11.165 + 11.166 +#content, #content_bottom, #content_top { 11.167 + background: white; 11.168 + color: black; 11.169 + text-align: justify; 11.170 +} 11.171 + 11.172 +#content { 11.173 + height: auto; 11.174 + margin: 6px 280px 0px 0px; 11.175 + padding: 0px 40px 60px 40px; 11.176 +} 11.177 + 11.178 +#content li { 11.179 + line-height: 1.5em; 11.180 + text-align: left; 11.181 +} 11.182 + 11.183 +/* Legal informations */ 11.184 + 11.185 +#copy { 11.186 + font-size: 11px ; 11.187 + text-align: center ; 11.188 + background: transparent; 11.189 + color: #a8a8a8; 11.190 + padding-top: 10px; 11.191 +} 11.192 + 11.193 +#copy a { 11.194 + background: inherit; 11.195 + color: #a8a8a8; 11.196 +} 11.197 + 11.198 +#copy a:hover { 11.199 + background: inherit; 11.200 + color: #666666; 11.201 +} 11.202 + 11.203 +/* Footer */ 11.204 + 11.205 +#bottom { 11.206 + float: none; 11.207 + background: inherit; 11.208 + color: black; 11.209 + width: auto; 11.210 + clear: both; 11.211 + padding: 0; 11.212 + margin: 0; 11.213 + text-align: center; 11.214 + vertical-align: middle; 11.215 +} 11.216 + 11.217 +#news li { 11.218 + list-style-type: square; 11.219 + border-bottom: 1px dotted #BEBEBE; 11.220 + margin-left: -25px; 11.221 + padding: 4px 0px 4px 0px; 11.222 +} 11.223 + 11.224 +#gallery { 11.225 + text-align: center; 11.226 +} 11.227 + 11.228 +#gallery table { 11.229 + margin: 30px 0px 30px 0px; 11.230 +} 11.231 + 11.232 +/* Clouds */ 11.233 + 11.234 +#cloud { 11.235 + padding: 20px 0px 20px 0px; 11.236 + line-height: 3em; 11.237 + text-align: center; 11.238 +} 11.239 +#cloud a { padding: 4px; color: #956411; } 11.240 +#cloud a.tag1 { font-size: 0.7em; font-weight: 100; } 11.241 +#cloud a.tag2 { font-size: 0.8em; font-weight: 200; } 11.242 +#cloud a.tag3 { font-size: 0.9em; font-weight: 300; } 11.243 +#cloud a.tag4 { font-size: 1.0em; font-weight: 400; } 11.244 +#cloud a.tag5 { font-size: 1.2em; font-weight: 500; } 11.245 +#cloud a.tag6 { font-size: 1.4em; font-weight: 600; } 11.246 +#cloud a.tag7 { font-size: 1.6em; font-weight: 700; } 11.247 +#cloud a.tag8 { font-size: 1.8em; font-weight: 800; } 11.248 +#cloud a.tag9 { font-size: 2.2em; font-weight: 900; } 11.249 +#cloud a.tag10 { font-size: 2.5em; font-weight: 900; } 11.250 + 11.251 +/* CSS class. */ 11.252 + 11.253 +.infobox { 11.254 + margin: 10px; 11.255 + padding: 12px; 11.256 + background: #f2f2f2; 11.257 + border: 1px solid #eaeaea; 11.258 + -moz-border-radius: 8px; 11.259 + -webkit-border-radius: 8px; 11.260 +} 11.261 + 11.262 +/* HTML styles */ 11.263 + 11.264 +h1 { 11.265 + color: blue; 11.266 + background: inherit; 11.267 + text-align: left; 11.268 + margin: 0px 0px 10px 0px; 11.269 + font-size: 140%; 11.270 + font-weight: bold; 11.271 +} 11.272 + 11.273 +h2 { 11.274 + color: #DF8F06; 11.275 + /* border-top: 1px solid #f3f3f3; */ 11.276 + border-left: 8px solid #f3f3f3; 11.277 + padding: 4px 0px 4px 4px; 11.278 + margin: 0; 11.279 + font-size: 140%; 11.280 + font-weight: bold; 11.281 +} 11.282 + 11.283 +h3 { 11.284 + font-weight: bold; 11.285 + color: #6c0023; 11.286 + background: inherit; 11.287 +} 11.288 + 11.289 +h3 img { 11.290 + vertical-align: middle; 11.291 + padding-right: 4px; 11.292 +} 11.293 + 11.294 +a { 11.295 + text-decoration: underline; 11.296 + color: #0F314E; 11.297 + background: inherit; 11.298 +} 11.299 + 11.300 +a:hover { 11.301 + text-decoration: none; 11.302 + color: blue; 11.303 + background: inherit; 11.304 +} 11.305 + 11.306 +code { 11.307 + font-size: 12px; 11.308 + color: #669900; 11.309 + background: inherit; 11.310 +} 11.311 + 11.312 +tt { 11.313 + color: #15EE15; 11.314 + background: inherit; 11.315 +} 11.316 + 11.317 +img { 11.318 + border: 0pt none; 11.319 +} 11.320 + 11.321 +fieldset { 11.322 + background: #E2ECf6; 11.323 + color: black; 11.324 + margin-top: 25px; 11.325 + border: 1px solid black; 11.326 +} 11.327 + 11.328 +legend { 11.329 + border: 1px solid black; 11.330 + color: #6c0023; 11.331 + background: #eaeaea; 11.332 + font-weight: bold; 11.333 +} 11.334 + 11.335 +pre { 11.336 + padding: 5px; 11.337 + color: black; 11.338 +} 11.339 + 11.340 +pre.script { 11.341 + padding: 10px; 11.342 + color: black; 11.343 + background: #E8E8E8; 11.344 + border: 1px inset #606060; 11.345 +} 11.346 + 11.347 +textarea { 11.348 + background: #E5E5E5; 11.349 + margin-top: 12px; 11.350 +} 11.351 + 11.352 +input[type=submit] { 11.353 + background: #E5E5E5; 11.354 + color: black; 11.355 + border: 1px outset #111111; 11.356 + font-weight: bold; 11.357 +} 11.358 + 11.359 +input[type=submit]:hover { 11.360 + background: #F3F3F3; 11.361 + color: black; 11.362 +} 11.363 + 11.364 +/* Packages pages */ 11.365 + 11.366 +.pkg_nav { 11.367 + border-top: 1px solid black; 11.368 + margin-top: 10px; 11.369 + padding-top: 10px; 11.370 +} 11.371 + 11.372 +pre.package { 11.373 + padding: 0px; 11.374 + color: black; 11.375 + background: white; 11.376 +} 11.377 + 11.378 +p.get { 11.379 + text-align: center; 11.380 + padding: 10px; 11.381 + color: black; 11.382 + background: #F3F3F3; 11.383 + border: 1px solid #DEDEDE; 11.384 +}
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 12.2 +++ b/manager/stuff/var/www/index.sh Wed Feb 02 13:43:52 2011 +0100 12.3 @@ -0,0 +1,223 @@ 12.4 +#!/bin/sh 12.5 + 12.6 +. /usr/bin/httpd_helper.sh 12.7 + 12.8 +cpu() 12.9 +{ 12.10 +grep '^model name' /proc/cpuinfo | head -n 1 | \ 12.11 +sed -e 's/.*Intel(R) //' -e 's/.*AMD //' -e 's/.*: //' \ 12.12 + -e 's/@//' -e 's/(R)//' -e 's/(TM)//' -e 's/CPU //' -e 's/Processor //' 12.13 +} 12.14 + 12.15 +cat <<EOT 12.16 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 12.17 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 12.18 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> 12.19 +<head> 12.20 + <title>status tiny server $(hostname) - $HTTP_HOST 12.21 + </title> 12.22 + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 12.23 + <meta name="description" content="Tiny server manager" /> 12.24 + <meta name="expires" content="never" /> 12.25 + <meta name="modified" content="2008-03-05 16:33:00" /> 12.26 + <link rel="shortcut icon" href="css/favicon.ico" /> 12.27 + <link rel="stylesheet" type="text/css" href="css/slitaz.css" /> 12.28 +</head> 12.29 +<body bgcolor="#ffffff"> 12.30 +<div id="header"> 12.31 + <a name="top"></a> 12.32 +<!-- Access --> 12.33 +<div id="access"> 12.34 +$([ -d /var/www/wiki ] && echo "<a href="/wiki/index.sh" title="Wiki">Wiki</a> |") 12.35 +$([ -n "$GET__NAMES" ] && echo "<a href="$SCRIPT_NAME" title="Status">Status</a> |") 12.36 + <a href="adm/index.sh?/sbin/poweroff" title="Poweroff">Power down</a> | 12.37 + <a href="adm/index.sh?/sbin/reboot" title="Reboot">Reboot</a> 12.38 +</div> 12.39 + <a href="http://www.slitaz.org/"><img id="logo" 12.40 + src="css/pics/website/logo.png" title="www.slitaz.org" 12.41 + alt="www.slitaz.org" 12.42 + style="border: 0px solid ; width: 200px; height: 74px;" /></a> 12.43 + <p id="titre">#!/tinyserver/status</p> 12.44 + 12.45 +</div> 12.46 +<!-- Navigation menu --> 12.47 +<div id="nav"> 12.48 + 12.49 +<div class="nav_box"> 12.50 +<h4>Services</h4> 12.51 + 12.52 +<!-- Start content --> 12.53 +<table> 12.54 +EOT 12.55 + 12.56 +for svr in $( . ../../etc/rcS.conf ; cd /usr/sbin ; ls pppd 2> /dev/null ; echo $RUN_DAEMONS | sed 's/ /\n/g' | sort) ; do 12.57 + status="<td>$svr</td><td><a href=\"adm/index.sh?stop=$svr\">stop</a></td><td><a href=\"adm/index.sh?restart=$svr\">restart</a></td>" 12.58 + grep -vs ^\# /etc/inetd.conf | grep -q $(which $svr) && 12.59 + [ -n "$(ps | grep -v grep | grep /usr/sbin/inetd)" ] || 12.60 + [ -n "$(ps | grep -v grep | grep $(which $svr) )" ] || 12.61 + status="<td><strike>$svr</strike></td><td><a href=\"adm/index.sh?start=$svr\">start</a></td><td></td>" 12.62 + case "$svr" in 12.63 + pppd) info="<td><a href=\"$SCRIPT_NAME?show=/etc/ppp/scripts/ppp-on,/etc/ppp/scripts/ppp-on-dialer,/etc/ppp/options\">scripts</a></td>";; 12.64 + tftpd) info="<td><a href=\"$SCRIPT_NAME?list=/boot\">files</a></td>";; 12.65 + ftpd) info="<td><a href=\"$SCRIPT_NAME?list=/var/ftp\">files</a></td>";; 12.66 + udhcpd) info="<td><a href=\"$SCRIPT_NAME?leases\">leases</a></td>";; 12.67 + httpd) info="<td><a href=\"$SCRIPT_NAME?httpinfo\">info</a></td>";; 12.68 + *) info="<td></td>";; 12.69 + esac 12.70 + echo -e " <tr>\n $status$info\n </tr>" 12.71 +done 12.72 +cat <<EOT 12.73 +</table> 12.74 +</div> 12.75 + 12.76 +<div class="nav_box"> 12.77 +<h4>Log files</h4> 12.78 +<table> 12.79 +EOT 12.80 +for i in $(ls /var/log); do 12.81 + case "$i" in 12.82 + boot-time|wtmp) continue;; 12.83 + esac 12.84 + cat <<EOT 12.85 +<tr> 12.86 +<td><a href="$SCRIPT_NAME?show=/var/log/$i" title="Show file /var/log/$i"> 12.87 +$i</a></td><td>$(du -h /var/log/$i | cut -f1)</td> 12.88 +</tr> 12.89 +EOT 12.90 +done 12.91 +cat <<EOT 12.92 +</table> 12.93 +</div> 12.94 + 12.95 +<div class="nav_box"> 12.96 +<h4>Configuration files</h4> 12.97 +<table> 12.98 +EOT 12.99 +for i in $(cd /etc ; ls *.conf); do 12.100 + cat <<EOT 12.101 +<tr> 12.102 +<td><a href="$SCRIPT_NAME?show=/etc/$i" title="Show file /etc/$i"> 12.103 +$i</a></td><td>$(du -h /etc/$i | cut -f1)</td> 12.104 +</tr> 12.105 +EOT 12.106 +done 12.107 +cat <<EOT 12.108 +</table> 12.109 +</div> 12.110 + 12.111 +</div> 12.112 + 12.113 +<div id="content"> 12.114 +<h4>$(date) - $(hostname) - $(cpu) - $HTTP_HOST</h4> 12.115 +EOT 12.116 +case "$GET__NAMES" in 12.117 +show) for i in $(GET show | sed 's/,/ /g'); do 12.118 + cat <<EOT 12.119 +<h2>File $i</h2> 12.120 +<pre> 12.121 +EOT 12.122 + case "$i" in 12.123 + /etc/ppp*) cat $i ;; 12.124 + *) su -c "cat $i" tux ;; 12.125 + esac 12.126 + cat <<EOT 12.127 +</pre> 12.128 +EOT 12.129 + done 12.130 + ;; 12.131 +list) cat <<EOT 12.132 +<h2>Files in $(GET list)</h2> 12.133 +<pre> 12.134 +$( su -c "cd $(GET list) && find * | xargs ls -ld" tux ) 12.135 +</pre> 12.136 +EOT 12.137 + ;; 12.138 +leases) cat <<EOT 12.139 +<h2>DHCP Leases</h2> 12.140 +<pre> 12.141 +$(cat /var/lib/misc/udhcpd.leases) 12.142 +</pre> 12.143 +EOT 12.144 + ;; 12.145 +httpinfo) cat <<EOT 12.146 +<h2>HTTP Infos</h2> 12.147 +<pre> 12.148 +$(httpinfo) 12.149 +</pre> 12.150 +EOT 12.151 + ;; 12.152 +*) cat <<EOT 12.153 +<a name="disk"></a> 12.154 +<h2>Disk usage</h2> 12.155 +<pre> 12.156 +$(df -h | sed '/^rootfs/d' | grep '\(^/dev\|Filesystem\)') 12.157 +</pre> 12.158 +<a name="network"></a> 12.159 +<h2>Network</h2> 12.160 +<h3>Interfaces</h3> 12.161 +<pre> 12.162 +$(ifconfig) 12.163 +</pre> 12.164 +<h3>Routing table</h3> 12.165 +<pre> 12.166 +$(route) 12.167 +</pre> 12.168 +<h3>Connexions</h3> 12.169 +<pre> 12.170 +$(netstat -ap) 12.171 +</pre> 12.172 +EOT 12.173 + [ -f /proc/net/ip_conntrack ] && cat <<EOT 12.174 +<h3>Active connexions</h3> 12.175 +<pre> 12.176 +$(cat /proc/net/ip_conntrack) 12.177 +</pre> 12.178 +EOT 12.179 + cat <<EOT 12.180 +<h3>Arp table</h3> 12.181 +<pre> 12.182 +$(arp) 12.183 +</pre> 12.184 +<a name="processes"></a> 12.185 +<h2>Processes</h2> 12.186 +<h3>Memory</h3> 12.187 +<pre> 12.188 +$(free) 12.189 +</pre> 12.190 +<h3>Process list</h3> 12.191 +<pre> 12.192 +Uptime $(uptime | sed 's/^\s*//') 12.193 +</pre> 12.194 +<pre> 12.195 +$(top -n1 -b) 12.196 +</pre> 12.197 +<a name="boot"></a> 12.198 +<h2>Boot command args</h2> 12.199 +<pre> 12.200 +$(cat /proc/cmdline) 12.201 +</pre> 12.202 +<a name="users"></a> 12.203 +<h2>Users</h2> 12.204 +<pre> 12.205 +$(last) 12.206 +</pre> 12.207 +EOT 12.208 + ;; 12.209 +esac 12.210 + 12.211 +cat <<EOT 12.212 +</div> 12.213 +<!-- End content --> 12.214 +<!-- Start of footer and copy notice --> 12.215 +<div id="copy"> 12.216 +<p> 12.217 +Copyright © $(date +%Y) <a href="http://www.slitaz.org/">SliTaz</a> - 12.218 + 12.219 +<a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a> 12.220 +</p> 12.221 +<!-- End of copy --> 12.222 +</div> 12.223 + 12.224 +</body> 12.225 +</html> 12.226 +EOT