tazpanel view network.cgi @ rev 41

Better CSS for pkgs.cgi and handle packages category as fast as we can
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 06 19:02:07 2011 +0200 (2011-04-06)
parents 5f2f88618292
children a7b1d69663c3
line source
1 #!/bin/sh
2 #
3 # Network configuration CGI interface
4 #
5 echo "Content-Type: text/html"
6 echo ""
8 # Common functions from libtazpanel
9 . lib/libtazpanel
10 get_config
12 # Include gettext helper script.
13 . /usr/bin/gettext.sh
15 # Export package name for gettext.
16 TEXTDOMAIN='tazpanel'
17 export TEXTDOMAIN
19 # Actions commands before page is displayed
20 case "$QUERY_STRING" in
21 start)
22 # Here we sleep a bit to let udhcp get the lease before reloading
23 # page with status
24 /etc/init.d/network.sh start >/dev/null
25 sleep 2 ;;
26 stop)
27 /etc/init.d/network.sh stop >/dev/null ;;
28 *)
29 continue ;;
30 esac
32 #
33 # Main Commands for pages
34 #
36 case "$QUERY_STRING" in
37 eth)
38 # Wired connections settings
39 xhtml_header
40 cat << EOT
41 <h2>`gettext "Ethernet connection`</h2>
42 <pre>
43 `grep ^[A-V] /etc/network.conf`
44 </pre>
45 EOT
46 ;;
47 wifi)
48 # Wireless connections settings
49 xhtml_header
50 cat << EOT
51 <h2>`gettext "Wireless connection`</h2>
52 <pre>
53 `grep ^WIFI_ /etc/network.conf`
54 </pre>
55 EOT
56 ;;
57 *)
58 # Main Network page starting with a summary
59 xhtml_header
60 cat << EOT
61 <h2>`gettext "Networking`</h2>
62 <p>
63 `gettext "Manage network connection and services`
64 </p>
65 <div id="actions">
66 <p>
67 `gettext "Connection:"`
68 <a class="button" href="$SCRIPT_NAME?start">`gettext "Start"`</a>
69 <a class="button" href="$SCRIPT_NAME?stop">`gettext "Stop"`</a>
70 </p>
71 </div>
73 `list_network_interfaces`
75 <h3>`gettext "Output of ifconfig"`</h3>
76 <pre>
77 `ifconfig`
78 </pre>
79 EOT
80 ;;
81 esac
83 xhtml_footer
84 exit 0