tazpanel view network.cgi @ rev 42

Add settings.cgi and split user config from index.cgi, add need CSS stuff and up POT
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 07 01:22:07 2011 +0200 (2011-04-07)
parents 167a97495e1c
children cf15cb2ff715
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 TITLE="- Network"
21 # Actions commands before page is displayed
22 case "$QUERY_STRING" in
23 start)
24 # Here we sleep a bit to let udhcp get the lease before reloading
25 # page with status
26 /etc/init.d/network.sh start >/dev/null
27 sleep 2 ;;
28 stop)
29 /etc/init.d/network.sh stop >/dev/null ;;
30 *)
31 continue ;;
32 esac
34 #
35 # Main Commands for pages
36 #
38 case "$QUERY_STRING" in
39 eth)
40 # Wired connections settings
41 xhtml_header
42 cat << EOT
43 <h2>`gettext "Ethernet connection`</h2>
44 <pre>
45 `grep ^[A-V] /etc/network.conf`
46 </pre>
47 EOT
48 ;;
49 wifi)
50 # Wireless connections settings
51 xhtml_header
52 cat << EOT
53 <h2>`gettext "Wireless connection`</h2>
54 <pre>
55 `grep ^WIFI_ /etc/network.conf`
56 </pre>
57 EOT
58 ;;
59 *)
60 # Main Network page starting with a summary
61 xhtml_header
62 cat << EOT
63 <h2>`gettext "Networking`</h2>
64 <p>
65 `gettext "Manage network connection and services`
66 </p>
67 <div id="actions">
68 <p>
69 `gettext "Connection:"`
70 <a class="button" href="$SCRIPT_NAME?start">`gettext "Start"`</a>
71 <a class="button" href="$SCRIPT_NAME?stop">`gettext "Stop"`</a>
72 </p>
73 </div>
75 `list_network_interfaces`
77 <h3>`gettext "Output of ifconfig"`</h3>
78 <pre>
79 `ifconfig`
80 </pre>
81 EOT
82 ;;
83 esac
85 xhtml_footer
86 exit 0