tazpanel view network.cgi @ rev 49

Update all page with latest functions such as debug, bunch of fixes and adding support for deamons
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 09 00:22:23 2011 +0200 (2011-04-09)
parents a7b1d69663c3
children 730f8bcacabc
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 debug_info
43 cat << EOT
44 <h2>`gettext "Ethernet connection`</h2>
45 <pre>
46 `grep ^[A-V] /etc/network.conf`
47 </pre>
48 EOT
49 ;;
50 wifi)
51 # Wireless connections settings
52 xhtml_header
53 debug_info
54 cat << EOT
55 <h2>`gettext "Wireless connection`</h2>
56 <pre>
57 `grep ^WIFI_ /etc/network.conf`
58 </pre>
59 EOT
60 ;;
61 *)
62 # Main Network page starting with a summary
63 xhtml_header
64 debug_info
65 cat << EOT
66 <h2>`gettext "Networking`</h2>
67 <p>
68 `gettext "Manage network connection and services`
69 </p>
70 <div id="actions">
71 <p>
72 `gettext "Connection:"`
73 <a class="button" href="$SCRIPT_NAME?start">`gettext "Start"`</a>
74 <a class="button" href="$SCRIPT_NAME?stop">`gettext "Stop"`</a>
75 </p>
76 </div>
78 `list_network_interfaces`
80 <h3>`gettext "Output of ifconfig"`</h3>
81 <pre>
82 `ifconfig`
83 </pre>
84 EOT
85 ;;
86 esac
88 xhtml_footer
89 exit 0