tazpanel view index.cgi @ rev 8

Implement system upgrade: faster than ever now!!!
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 02 13:55:29 2011 +0200 (2011-04-02)
parents 4a672cf82ad2
children 64f564036b88
line source
1 #!/bin/sh
2 #
3 # CGI/Shell script example for TazPanel
4 #
5 echo "Content-Type: text/html"
6 echo ""
8 . tazpanel.conf
10 xhtml_header() {
11 # xHTML 5 header
12 cat $HEADER | sed s/'- %TITLE%'/"$TITLE"/
13 }
15 [ $DEBUG == "1" ] && echo "<p class='debug'>DEBUG on</p>"
17 #
18 # Commands
19 #
21 case "$QUERY_STRING" in
22 users)
23 TITLE="- Users"
24 xhtml_header
25 echo '<ul>'
26 fgrep /home /etc/passwd | while read line
27 do
28 echo '<li>'
29 echo " <img src='$IMAGES/user.png' />$line"
30 echo '</li>'
31 done
32 echo '</ul>' ;;
33 network)
34 TITLE="- Network"
35 xhtml_header
36 echo '<pre>'
37 ifconfig
38 echo '</pre>' ;;
39 hardware)
40 TITLE="- Hardware"
41 xhtml_header
42 echo '<pre>'
43 lspci
44 echo '</pre>' ;;
45 *)
46 # Default xHTML content
47 xhtml_header
48 cat << EOT
49 <p>
50 Uptime: `uptime`
51 </p>
52 EOT
53 ;;
54 esac
56 # xHTML 5 footer
57 cat $FOOTER