tazpanel view index.cgi @ rev 46

Add hardware.cgi, tiny fix in pkgs.cgi and add a TODO list
author Christophe Lincoln <pankso@slitaz.org>
date Fri Apr 08 05:59:24 2011 +0200 (2011-04-08)
parents af4b1f0b3110
children cf15cb2ff715
line source
1 #!/bin/sh
2 #
3 # Main CGI interface for TazPanel. In on word: KISS. Use the main cas form
4 # command so we are faster and dont load unneeded function. If nececarry
5 # you can use the lib/ dir to handle external resources.
6 #
7 # Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
8 #
9 echo "Content-Type: text/html"
10 echo ""
12 # Common functions from libtazpanel
13 . lib/libtazpanel
14 get_config
16 # Include gettext helper script.
17 . /usr/bin/gettext.sh
19 # Export package name for gettext.
20 TEXTDOMAIN='tazpanel'
21 export TEXTDOMAIN
23 #
24 # Commands
25 #
27 case "$QUERY_STRING" in
28 boot)
29 #
30 # Everything until user login
31 #
32 . /etc/rcS.conf
33 TITLE="- Boot"
34 xhtml_header
35 cat << EOT
36 <div id="wrapper">
37 <h2>`gettext "Boot &amp; startup"`</h2>
38 <p>
39 `gettext "Everything that appends before user login."`
40 </p>
41 </div>
43 <h3>`gettext "Kernel cmdline"`</h3>
44 <pre>
45 `cat /proc/cmdline`
46 </pre>
48 <h3>`gettext "Local startup commands"`</h3>
49 <pre>
50 `cat /etc/init.d/local.sh`
51 </pre>
52 EOT
53 ;;
54 *)
55 #
56 # Default xHTML content
57 #
58 xhtml_header
59 case "$QUERY_STRING" in
60 gen-locale=*)
61 new_locale=${QUERY_STRING#gen-locale=} ;;
62 rdate)
63 echo "" ;;
64 esac
65 cat << EOT
66 <div id="wrapper">
67 <h2>`gettext "Host:"` `hostname`</h2>
68 <p>`gettext "SliTaz administration et configuration Panel"`<p>
69 </div>
71 <h3>`gettext "Summary"`</h3>
72 <div id="summary">
73 <p>
74 `gettext "Uptime:"` `uptime`
75 </p>
76 <p>
77 `gettext "Memory in Mb"`
78 `free -m | grep Mem: | awk \
79 '{print "| Total:", $2, "| Used:", $3, "| Free:", $4}'`
80 </p>
81 <!-- Close summary -->
82 </div>
84 <h4>`gettext "Network status"`</h4>
85 `list_network_interfaces`
87 <h4>`gettext "Filesystem usage statistics"`</h4>
88 <pre>
89 `df -h | grep ^/dev`
90 </pre>
91 EOT
92 ;;
93 esac
95 xhtml_footer
96 exit 0