slitaz-tools rev 194 2.4

netbox: use the nice new icon... and have a Help dialog
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 16 00:55:24 2008 +0200 (2008-05-16)
parents 2b4ebc92f71b
children 9c469ae182bc
files tinyutils/netbox
line diff
     1.1 --- a/tinyutils/netbox	Fri May 16 00:22:59 2008 +0200
     1.2 +++ b/tinyutils/netbox	Fri May 16 00:55:24 2008 +0200
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# 
     1.6 +#
     1.7  # Gtkdialog box to manage network connexion.
     1.8  # - SliTaz GNU/Linux 2008.
     1.9  #
    1.10 @@ -10,7 +10,7 @@
    1.11  {
    1.12  	if test $(id -u) != 0 ; then
    1.13  		echo -e "
    1.14 -You must be root to run `basename $0`. Please type 'su' and 
    1.15 +You must be root to run `basename $0`. Please type 'su' and
    1.16  root password to become super-user.\n"
    1.17  		exit 0
    1.18  	fi
    1.19 @@ -80,11 +80,34 @@
    1.20  	exit 1
    1.21  fi
    1.22  
    1.23 +# English/French help dialod.
    1.24 +export HELP='
    1.25 +<window title="Network status" icon-name="network-wire">
    1.26 +<vbox>
    1.27 +    <text use-markup="true">
    1.28 +    <label>"
    1.29 +<b>SliTaz - Netbox</b>"
    1.30 +    </label>
    1.31 +  </text>
    1.32 +  <frame English>
    1.33 +    <text wrap="true" width-chars="58">
    1.34 +      <label>
    1.35 +"Netbox let you manage network connections getting dynamic IP by DHCP
    1.36 +or static IP, and setup servers. Netbox can start or stop networking,
    1.37 +configure network interfaces or directly edit files. Wifi users may
    1.38 +configure System wide / Network."
    1.39 +      </label>
    1.40 +      </text>
    1.41 +    </frame>
    1.42 +</vbox>
    1.43 +</window>
    1.44 +'
    1.45 +
    1.46  # Interafce status with ifconfig without arguments to show all
    1.47  # active connections.
    1.48  #
    1.49  export IFCONFIG='
    1.50 -<window title="Network status" icon-name="network-wired">
    1.51 +<window title="Network status" icon-name="network-wire">
    1.52    <vbox>
    1.53      <text wrap="false">
    1.54        <input>date</input>
    1.55 @@ -147,24 +170,18 @@
    1.56  # Note than /etc/network.conf is seded wehwn an interafce is activate
    1.57  #
    1.58  NET_BOX='
    1.59 -<window title="Netbox" icon-name="network-wired">
    1.60 +<window title="SliTaz Netbox Manager" icon-name="network-wired">
    1.61    <vbox>
    1.62 -    <text use-markup="true">
    1.63 -      <label>
    1.64 -"
    1.65 -<b>SliTaz - Netbox</b>"
    1.66 -      </label>
    1.67 -    </text>
    1.68 -    <text wrap="true" width-chars="60">
    1.69 -      <label>
    1.70 -"Manage network connections getting dynamic IP by DHCP or static IP,
    1.71 -and setup servers. Netbox can start or stop networking, configure 
    1.72 -network interfaces or directly edit files. Wifi users may configure
    1.73 -System wide / Network.
    1.74 -"
    1.75 -      </label>
    1.76 -    </text>
    1.77 -    
    1.78 +
    1.79 +    <hbox>
    1.80 +		<text use-markup="true">
    1.81 +			<label>"<b>Network/Server Manager</b>"</label>
    1.82 +		</text>
    1.83 +		<pixmap>
    1.84 +			<input file>/usr/share/pixmaps/netbox.png</input>
    1.85 +		</pixmap>
    1.86 +	</hbox>
    1.87 +
    1.88      <frame General>
    1.89        <hbox>
    1.90          <text use-markup="true">
    1.91 @@ -176,11 +193,11 @@
    1.92          </entry>
    1.93        </hbox>
    1.94      </frame>
    1.95 -  
    1.96 +
    1.97      <notebook labels="DHCP|PPPoE|Static IP|System wide|VPN|Servers'
    1.98  [ -x /sbin/iptables ] && NET_BOX="$NET_BOX|Firewall"
    1.99  tmp='|Etherwake">
   1.100 -  
   1.101 +
   1.102      <frame Udhcpc>
   1.103        <hbox>
   1.104          <text use-markup="true">
   1.105 @@ -213,7 +230,7 @@
   1.106          </button>
   1.107        </hbox>
   1.108      </frame>
   1.109 -    
   1.110 +
   1.111      <frame PPPoE>
   1.112        <hbox>
   1.113          <text use-markup="true">
   1.114 @@ -268,7 +285,7 @@
   1.115          </button>
   1.116        </hbox>
   1.117      </frame>
   1.118 -    
   1.119 +
   1.120      <frame Configuration>
   1.121        <hbox>
   1.122          <text use-markup="true">
   1.123 @@ -329,7 +346,7 @@
   1.124          </button>
   1.125        </hbox>
   1.126      </frame>
   1.127 -    
   1.128 +
   1.129      <frame Configuration files>
   1.130        <hbox>
   1.131          <text use-markup="true">
   1.132 @@ -382,7 +399,7 @@
   1.133          </button>
   1.134        </hbox>
   1.135      </frame>
   1.136 -    
   1.137 +
   1.138      <frame Virtual Private Network with PPP/SSH>
   1.139        <hbox>
   1.140          <text use-markup="true">
   1.141 @@ -442,16 +459,16 @@
   1.142  NET_BOX="$NET_BOX$tmp"
   1.143  tmp=''
   1.144  [ -x /usr/sbin/dropbear ] && NET_BOX="${NET_BOX}${tmp}SSH"   && tmp='|'
   1.145 -[ -x /usr/sbin/inetd    ] && NET_BOX="${NET_BOX}${tmp}INETD" && tmp='|' 
   1.146 -[ -x /usr/sbin/udhcpd   ] && NET_BOX="${NET_BOX}${tmp}DHCP"  && tmp='|' 
   1.147 +[ -x /usr/sbin/inetd    ] && NET_BOX="${NET_BOX}${tmp}INETD" && tmp='|'
   1.148 +[ -x /usr/sbin/udhcpd   ] && NET_BOX="${NET_BOX}${tmp}DHCP"  && tmp='|'
   1.149  [ -f /usr/share/boot/pxelinux.0.lzma -a -x /usr/bin/tftpd -a \
   1.150    -x /usr/sbin/inetd -a -x /usr/sbin/udhcpd ] \
   1.151                            && NET_BOX="${NET_BOX}${tmp}PXE"   && tmp='|'
   1.152 -[ -x /usr/sbin/dnsd     ] && NET_BOX="${NET_BOX}${tmp}DNS"   && tmp='|' 
   1.153 -[ -x /usr/bin/rsync     ] && NET_BOX="${NET_BOX}${tmp}RSYNC" && tmp='|' 
   1.154 -[ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}HTTP"  && tmp='|' 
   1.155 -[ -x /usr/sbin/smbd     ] && NET_BOX="${NET_BOX}${tmp}WINS"  && tmp='|' 
   1.156 -[ -x /usr/bin/x11vnc    ] && NET_BOX="${NET_BOX}${tmp}VNC"   && tmp='|' 
   1.157 +[ -x /usr/sbin/dnsd     ] && NET_BOX="${NET_BOX}${tmp}DNS"   && tmp='|'
   1.158 +[ -x /usr/bin/rsync     ] && NET_BOX="${NET_BOX}${tmp}RSYNC" && tmp='|'
   1.159 +[ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}HTTP"  && tmp='|'
   1.160 +[ -x /usr/sbin/smbd     ] && NET_BOX="${NET_BOX}${tmp}WINS"  && tmp='|'
   1.161 +[ -x /usr/bin/x11vnc    ] && NET_BOX="${NET_BOX}${tmp}VNC"   && tmp='|'
   1.162  . /etc/daemons.conf
   1.163  set -- $DROPBEAR_OPTIONS
   1.164  while [ -n "$2" ]; do
   1.165 @@ -592,7 +609,7 @@
   1.166        </hbox>
   1.167       </frame>
   1.168  '
   1.169 -[ -x /usr/sbin/inetd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 
   1.170 +[ -x /usr/sbin/inetd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
   1.171  tmp='<frame Dhcpd>
   1.172        <hbox>
   1.173          <text use-markup="true">
   1.174 @@ -642,7 +659,7 @@
   1.175        </hbox>
   1.176       </frame>
   1.177  '
   1.178 -[ -x /usr/sbin/udhcpd   ] && NET_BOX="${NET_BOX}$tmp$tmp2" 
   1.179 +[ -x /usr/sbin/udhcpd   ] && NET_BOX="${NET_BOX}$tmp$tmp2"
   1.180  tmp='<frame Pxelinux>
   1.181        <hbox>
   1.182          <text wrap="true">
   1.183 @@ -731,7 +748,7 @@
   1.184        </hbox>
   1.185       </frame>
   1.186  '
   1.187 -[ -x /usr/sbin/dnsd     ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 
   1.188 +[ -x /usr/sbin/dnsd     ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
   1.189  tmp='<frame Rsync>
   1.190        <hbox>
   1.191          <text use-markup="true">
   1.192 @@ -794,7 +811,7 @@
   1.193        </hbox>
   1.194       </frame>
   1.195  '
   1.196 -[ -x /usr/bin/rsync    ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 
   1.197 +[ -x /usr/bin/rsync    ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
   1.198  tmp='<frame Lighttpd>'
   1.199  tmp2='<frame PHP>
   1.200         <hbox>
   1.201 @@ -812,7 +829,7 @@
   1.202         </hbox>
   1.203        </frame>
   1.204  '
   1.205 -[ -f /etc/php.ini ] && tmp="${tmp}${tmp2}" 
   1.206 +[ -f /etc/php.ini ] && tmp="${tmp}${tmp2}"
   1.207  tmp2='<hbox>
   1.208          <text use-markup="true">
   1.209            <label>"<b>Configuration :</b>"</label>
   1.210 @@ -843,7 +860,7 @@
   1.211        </hbox>
   1.212       </frame>
   1.213  '
   1.214 -[ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 
   1.215 +[ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
   1.216  tmp='<frame Samba: smbd & nmbd>
   1.217        <hbox>
   1.218          <text use-markup="true">
   1.219 @@ -1002,20 +1019,24 @@
   1.220      <hbox>
   1.221        <button>
   1.222          <label>Status</label>
   1.223 -        <input file icon="network-wired"></input>
   1.224 +        <input file icon="dialog-information"></input>
   1.225  	    <action type="launch">IFCONFIG</action>
   1.226        </button>
   1.227 +      <button help>
   1.228 +			<label>Help</label>
   1.229 +			<action type="launch">HELP</action>
   1.230 +		</button>
   1.231        <button>
   1.232          <label>Quit</label>
   1.233          <input file icon="exit"></input>
   1.234          <action type="exit">Exit</action>
   1.235        </button>
   1.236      </hbox>
   1.237 -  
   1.238 +
   1.239    </vbox>
   1.240  </window>
   1.241  '
   1.242 -NET_BOX="${NET_BOX}${tmp}" 
   1.243 +NET_BOX="${NET_BOX}${tmp}"
   1.244  
   1.245  export NET_BOX
   1.246