slitaz-tools view tinyutils/netbox @ rev 129

netbox: add servers status
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 08 08:58:52 2008 +0000 (2008-04-08)
parents 36695da47702
children 312a02ab6a83
line source
1 #!/bin/sh
2 #
3 # Gtkdialog box to manage network connexion.
4 # - SliTaz GNU/Linux 2008.
5 #
6 VERSION=20080113
8 # Check if user is root.
9 check_root()
10 {
11 if test $(id -u) != 0 ; then
12 echo -e "
13 You must be root to run `basename $0`. Please type 'su' and
14 root password to become super-user.\n"
15 exit 0
16 fi
17 }
19 # Interafce status with ifconfig without arguments to show all
20 # active connections.
21 #
22 export IFCONFIG='
23 <window title="Network status" icon-name="network-wired">
24 <vbox>
25 <text use-markup="true">
26 <label>"
27 <b>Active network interfaces</b>"
28 </label>
29 </text>
30 <text wrap="false">
31 <input>date</input>
32 </text>
33 <frame Ifconfig>
34 <text wrap="false" width-chars="58">
35 <input>ifconfig</input>
36 </text>
37 </frame>
38 <text use-markup="true">
39 <label>"
40 <b>Active network servers</b>"
41 </label>
42 </text>
43 <frame Servers>
44 <text wrap="false" width-chars="58">
45 <input>for i in dropbear tftpd udhcpd dnsd rsync lighttpd ; do ps w | grep $i | grep -v grep; done</input>
46 </text>
47 </frame>
48 <hbox>
49 <button>
50 <input file icon="exit"></input>
51 <action type="closewindow">IFCONFIG</action>
52 </button>
53 </hbox>
54 </vbox>
55 </window>
56 '
58 # The main dialog with notebook, start/stop buttons and all options.
59 # Note than /etc/network.conf is seded wehwn an interafce is activate
60 #
61 NET_BOX='
62 <window title="Netbox" icon-name="network-wired">
63 <vbox>
64 <text use-markup="true">
65 <label>
66 "
67 <b>SliTaz - Netbox</b>"
68 </label>
69 </text>
70 <text wrap="true" width-chars="44">
71 <label>
72 "
73 Manage network connections getting dynamic IP
74 by DHCP or static IP, and setup servers.
75 Netbox can start or stop networking, configure
76 network interfaces or directly edit files.
77 "
78 </label>
79 </text>
81 <frame General>
82 <hbox>
83 <text use-markup="true">
84 <label>"<b>Interface :</b>"</label>
85 </text>
86 <entry>
87 <input>. /etc/network.conf; echo $INTERFACE</input>
88 <variable>INTERFACE</variable>
89 </entry>
90 </hbox>
91 </frame>
93 <notebook labels="DHCP|Static IP|System wide|Servers">
95 <frame Udhcpc>
96 <hbox>
97 <text use-markup="true">
98 <label>"<b>Options :</b>"</label>
99 </text>
100 <entry>
101 <default>-b</default>
102 <variable>UDHCPC_OPTS</variable>
103 </entry>
104 <button>
105 <input file icon="help"></input>
106 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x27 -title "udhcpc help" -e "udhcpc --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
107 </button>
108 </hbox>
109 <hbox>
110 <button>
111 <label>Start</label>
112 <input file icon="forward"></input>
113 <action>sed -i s/`cat /etc/network.conf | grep ^INTERFACE=`/INTERFACE=\"$INTERFACE\"/ /etc/network.conf</action>
114 <action>sed -i s/DHCP=\"no\"/DHCP=\"yes\"/ /etc/network.conf</action>
115 <action>sed -i s/STATIC=\"yes\"/STATIC=\"no\"/ /etc/network.conf</action>
116 <action>udhcpc $UDHCPC_OPTS -i $INTERFACE -p /var/run/udhcpc.$INTERFACE.pid</action>
117 </button>
118 <button>
119 <label>Stop</label>
120 <input file icon="stop"></input>
121 <action>echo -n "Stopping interface : $INTERFACE... "</action>
122 <action>ifconfig $INTERFACE down</action>
123 <action>killall -q udhcpc; echo "done"</action>
124 </button>
125 </hbox>
126 </frame>
128 <frame Configuration>
129 <hbox>
130 <text use-markup="true">
131 <label>"<b>IP :</b>"</label>
132 </text>
133 <entry>
134 <input>. /etc/network.conf; echo "$IP"</input>
135 <variable>IP</variable>
136 </entry>
137 </hbox>
138 <hbox>
139 <text use-markup="true">
140 <label>"<b>Netmask :</b>"</label>
141 </text>
142 <entry>
143 <input>. /etc/network.conf; echo "$NETMASK"</input>
144 <variable>NETMASK</variable>
145 </entry>
146 </hbox>
147 <hbox>
148 <text use-markup="true">
149 <label>"<b>Gateway :</b>"</label>
150 </text>
151 <entry>
152 <input>. /etc/network.conf; echo "$GATEWAY"</input>
153 <variable>GATEWAY</variable>
154 </entry>
155 </hbox>
156 <hbox>
157 <text use-markup="true">
158 <label>"<b>DNS server :</b>"</label>
159 </text>
160 <entry>
161 <input>. /etc/network.conf; echo "$DNS_SERVER"</input>
162 <variable>DNS_SERVER</variable>
163 </entry>
164 </hbox>
165 <hbox>
166 <button>
167 <label>Start</label>
168 <input file icon="forward"></input>
169 <action>ifconfig lo down</action>
170 <action>ifconfig $INTERFACE down</action>
171 <action>sed -i s/`cat /etc/network.conf | grep ^INTERFACE=`/INTERFACE=\"$INTERFACE\"/ /etc/network.conf</action>
172 <action>sed -i s/DHCP=\"yes\"/DHCP=\"no\"/ /etc/network.conf</action>
173 <action>sed -i s/STATIC=\"no\"/STATIC=\"yes\"/ /etc/network.conf</action>
174 <action>sed -i s/`cat /etc/network.conf | grep ^IP=`/IP=\"$IP\"/ /etc/network.conf</action>
175 <action>sed -i s/`cat /etc/network.conf | grep ^NETMASK=`/NETMASK=\"$NETMASK\"/ /etc/network.conf</action>
176 <action>sed -i s/`cat /etc/network.conf | grep ^GATEWAY=`/GATEWAY=\"$GATEWAY\"/ /etc/network.conf</action>
177 <action>sed -i s/`cat /etc/network.conf | grep ^DNS_SERVER=`/DNS_SERVER=\"$DNS_SERVER\"/ /etc/network.conf</action>
178 <action>/etc/init.d/network.sh</action>
179 </button>
180 <button>
181 <label>Stop</label>
182 <input file icon="stop"></input>
183 <action>echo -n "Stopping interface : $INTERFACE... "</action>
184 <action>ifconfig $INTERFACE down; echo "done"</action>
185 </button>
186 </hbox>
187 </frame>
189 <frame Configuration files>
190 <hbox>
191 <text use-markup="true">
192 <label>"<b>Hosts :</b>"</label>
193 </text>
194 <entry editable="false">
195 <default>/etc/hosts</default>
196 <variable>HOSTS</variable>
197 </entry>
198 <button>
199 <input file icon="accessories-text-editor"></input>
200 <action type="lauch">leafpad $HOSTS</action>
201 </button>
202 </hbox>
203 <hbox>
204 <text use-markup="true">
205 <label>"<b>Host name :</b>"</label>
206 </text>
207 <entry editable="false">
208 <default>/etc/hostname</default>
209 <variable>HOSTNAME</variable>
210 </entry>
211 <button>
212 <input file icon="accessories-text-editor"></input>
213 <action type="lauch">leafpad $HOSTNAME</action>
214 </button>
215 </hbox>
216 <hbox>
217 <text use-markup="true">
218 <label>"<b>Network :</b>"</label>
219 </text>
220 <entry editable="false">
221 <default>/etc/network.conf</default>
222 <variable>CONFIG_FILE</variable>
223 </entry>
224 <button>
225 <input file icon="accessories-text-editor"></input>
226 <action type="lauch">leafpad $CONFIG_FILE</action>
227 </button>
228 </hbox>
229 <hbox>
230 <button>
231 <label>Restart</label>
232 <input file icon="reload"></input>
233 <action>echo -n "Stopping interface : $INTERFACE... "</action>
234 <action>ifconfig lo down</action>
235 <action>ifconfig $INTERFACE down</action>
236 <action>killall -q udhcpc; echo "done"</action>
237 <action>/etc/init.d/network.sh</action>
238 </button>
239 </hbox>
240 </frame>
241 <notebook labels="'
242 tmp=''
243 [ -x /usr/sbin/dropbear ] && NET_BOX="${NET_BOX}${tmp}SSH" && tmp='|'
244 [ -x /usr/bin/tftpd ] && NET_BOX="${NET_BOX}${tmp}TFTP" && tmp='|'
245 [ -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}DHCP" && tmp='|'
246 [ -f /usr/share/boot/pxelinux.0.lzma -a -x /usr/bin/tftpd -a \
247 -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}PXE" && tmp='|'
248 [ -x /usr/sbin/dnsd ] && NET_BOX="${NET_BOX}${tmp}DNS" && tmp='|'
249 [ -x /usr/bin/rsync ] && NET_BOX="${NET_BOX}${tmp}RSYNC" && tmp='|'
250 [ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}HTTP" && tmp='|'
251 . /etc/daemons.conf
252 set -- $DROPBEAR_OPTIONS
253 while [ -n "$2" ]; do
254 [ "$1" = "-b" ] && DROPBEAR_BANNER="$2" && break
255 shift
256 done
257 NET_BOX="${NET_BOX}\">"
258 tmp='<frame Dropbear>
259 <hbox>
260 <text use-markup="true">
261 <label>"<b>DROPBEAR_OPTIONS</b>"</label>
262 </text>
263 <entry editable="false">'
264 [ -n "$DROPBEAR_OPTIONS" ] && tmp="$tmp<default>$DROPBEAR_OPTIONS</default>"
265 tmp2='
266 <variable>DROPBEAR_OPTS</variable>
267 </entry>
268 <button>
269 <input file icon="help"></input>
270 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x30 -title "dropbear help" -e "dropbear --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
271 </button>
272 <button>
273 <input file icon="accessories-text-editor"></input>
274 <action type="lauch">leafpad /etc/daemons.conf</action>
275 </button>
276 </hbox>
277 <hbox>
278 <text use-markup="true">
279 <label>"<b>Banner :</b>"</label>
280 </text>
281 <entry editable="false">'
282 [ -n "$DROPBEAR_BANNER" ] && tmp="$tmp$tmp2<default>$DROPBEAR_BANNER</default>"
283 tmp2='
284 <variable>DROPBEAR_BANNER</variable>
285 </entry>
286 <button>
287 <input file icon="accessories-text-editor"></input>
288 <action type="lauch">leafpad $DROPBEAR_BANNER</action>
289 </button>
290 </hbox>
291 <hbox>
292 <button>
293 <label>Start</label>
294 <input file icon="forward"></input>
295 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)dropbear \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
296 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"dropbear \1\"/" /etc/rcS.conf</action>
297 <action>/etc/init.d/dropbear start</action>
298 </button>
299 <button>
300 <label>Stop</label>
301 <input file icon="stop"></input>
302 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)dropbear \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
303 <action>/etc/init.d/dropbear stop</action>
304 </button>
305 </hbox>
306 </frame>
307 '
308 [ -x /usr/sbin/dropbear ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
309 set -- $TFTPD_OPTIONS
310 TFTPD_OPTS=""
311 while [ -n "$2" ]; do
312 TFTPD_OPTS="$TFTPD_OPTS $1"
313 shift
314 done
315 TFTPD_ROOT="$1"
316 tmp='<frame Tftpd>
317 <hbox>
318 <text use-markup="true">
319 <label>"<b>TFTPD_OPTIONS</b>"</label>
320 </text>
321 <entry editable="false">'
322 [ -n "$TFTPD_OPTS" ] && tmp="$tmp<default>$TFTPD_OPTS</default>"
323 tmp2='
324 <variable>TFTPD_OPTS</variable>
325 </entry>
326 <button>
327 <input file icon="help"></input>
328 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x13 -title "tftpd help" -e "tftpd --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
329 </button>
330 <button>
331 <input file icon="accessories-text-editor"></input>
332 <action type="lauch">leafpad /etc/daemons.conf</action>
333 </button>
334 </hbox>
335 <hbox>
336 <text use-markup="true">
337 <label>"<b>Root path :</b>"</label>
338 </text>
339 <entry editable="false">'
340 tmp="$tmp$tmp2"
341 [ -n "$TFTPD_ROOT" ] && tmp="$tmp<default>$TFTPD_ROOT</default>"
342 tmp2='
343 <variable>TFTPD_ROOT</variable>
344 </entry>
345 </hbox>
346 <hbox>
347 <button>
348 <label>Start</label>
349 <input file icon="forward"></input>
350 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)tftpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
351 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"tftpd \1\"/" /etc/rcS.conf</action>
352 <action>/etc/init.d/tftpd start</action>
353 </button>
354 <button>
355 <label>Stop</label>
356 <input file icon="stop"></input>
357 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)tftpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
358 <action>/etc/init.d/tftpd start</action>
359 </button>
360 </hbox>
361 </frame>
362 '
363 [ -x /usr/bin/tftpd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
364 tmp='<frame Dhcpd>
365 <hbox>
366 <text use-markup="true">
367 <label>"<b>Configuration :</b>"</label>
368 </text>
369 <entry editable="false">
370 <default>/etc/udhcpd.conf</default>
371 <variable>UDHCPD_CONF</variable>
372 </entry>
373 <button>
374 <input file icon="accessories-text-editor"></input>
375 <action type="lauch">leafpad $UDHCPD_CONF</action>
376 </button>
377 </hbox>
378 <hbox>
379 <button>
380 <label>Start</label>
381 <input file icon="forward"></input>
382 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)udhcpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
383 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"udhcpd \1\"/" /etc/rcS.conf</action>
384 <action>/etc/init.d/udhcpd start</action>
385 </button>
386 <button>
387 <label>Stop</label>
388 <input file icon="stop"></input>
389 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)udhcpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
390 <action>/etc/init.d/udhcpd stop</action>
391 </button>
392 </hbox>
393 </frame>
394 '
395 [ -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}"
396 tmp='<frame Pxelinux>
397 <hbox>
398 <text wrap="true">
399 <label>
400 "Tftpd and Dhcpd must be lauched to start the PXE service."
401 </label>
402 </text>
403 </hbox>
404 <hbox>
405 <text use-markup="true">
406 <label>"<b>Configuration :</b>"</label>
407 </text>
408 <entry editable="false">
409 <default>pxelinux.cfg/default</default>
410 <variable>PXE_CONF</variable>
411 </entry>
412 <button>
413 <input file icon="accessories-text-editor"></input>
414 <action>dir=$(dirname $TFTPD_ROOT/$PXE_CONF); [ -d $dir ] || mkdir -p $dir</action>
415 <action>lzma d /usr/share/boot/pxelinux.0.lzma $TFTPD_ROOT/pxelinux.0</action>
416 <action>grep "^option bootfile=pxelinux.0" $UDHCPD_CONF || echo "option bootfile=pxelinux.0" >> $UDHCPD_CONF</action>
417 <action>[ -f $TFTPD_ROOT/$PXE_CONF ] || echo -e "label slitaz\n\tkernel bzImage\n\tappend initrd=rootfs.gz rw root=/dev/null vga=normal" > $TFTPD_ROOT/$PXE_CONF</action>
418 <action type="lauch">leafpad $TFTPD_ROOT/$PXE_CONF</action>
419 </button>
420 </hbox>
421 </frame>
422 '
423 [ -f /usr/share/boot/pxelinux.0.lzma -a -x /usr/bin/tftpd -a \
424 -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}"
425 tmp='<frame Dnsd>
426 <hbox>
427 <text use-markup="true">
428 <label>"<b>DNSD_OPTIONS</b>"</label>
429 </text>
430 <entry editable="false">'
431 [ -n "$DNSD_OPTIONS" ] && tmp="$tmp<default>$DNSD_OPTIONS</default>"
432 tmp2='
433 <variable>DNSD_OPTS</variable>
434 </entry>
435 <button>
436 <input file icon="help"></input>
437 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x15 -title "dnsd help" -e "dnsd --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
438 </button>
439 <button>
440 <input file icon="accessories-text-editor"></input>
441 <action type="lauch">leafpad /etc/daemons.conf</action>
442 </button>
443 </hbox>
444 <hbox>
445 <text use-markup="true">
446 <label>"<b>Configuration :</b>"</label>
447 </text>
448 <entry editable="false">
449 <default>/etc/dnsd.conf</default>
450 <variable>DNSD_CONF</variable>
451 </entry>
452 <button>
453 <input file icon="accessories-text-editor"></input>
454 <action type="lauch">leafpad $DNSD_CONF</action>
455 </button>
456 </hbox>
457 <hbox>
458 <button>
459 <label>Start</label>
460 <input file icon="forward"></input>
461 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)dnsd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
462 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"dnsd \1\"/" /etc/rcS.conf</action>
463 <action>/etc/init.d/dnsd start</action>
464 </button>
465 <button>
466 <label>Stop</label>
467 <input file icon="stop"></input>
468 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)dnsd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
469 <action>/etc/init.d/dnsd stop</action>
470 </button>
471 </hbox>
472 </frame>
473 '
474 [ -x /usr/sbin/dnsd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
475 tmp='<frame Rsync>
476 <hbox>
477 <text use-markup="true">
478 <label>"<b>RSYNCD_OPTIONS</b>"</label>
479 </text>
480 <entry editable="false">'
481 [ -n "${RSYNCD_OPTIONS#* }" ] && tmp="$tmp<default>${RSYNCD_OPTIONS#* }</default>"
482 tmp2='
483 <variable>RSYNC_OPTS</variable>
484 </entry>
485 <button>
486 <input file icon="help"></input>
487 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 80x30 -title "rsync daemon help" -e "rsync --daemon --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
488 </button>
489 <button>
490 <input file icon="accessories-text-editor"></input>
491 <action type="lauch">leafpad /etc/daemons.conf</action>
492 </button>
493 </hbox>
494 <hbox>
495 <text use-markup="true">
496 <label>"<b>Configuration :</b>"</label>
497 </text>
498 <entry editable="false">
499 <default>/etc/rsyncd.conf</default>
500 <variable>RSYNCD_CONF</variable>
501 </entry>
502 <button>
503 <input file icon="accessories-text-editor"></input>
504 <action type="lauch">leafpad $RSYNCD_CONF</action>
505 </button>
506 </hbox>
507 <hbox>
508 <text use-markup="true">
509 <label>"<b>Secrets file :</b>"</label>
510 </text>
511 <entry editable="true">
512 <default>/etc/rsyncd.secrets</default>
513 <variable>RSYNCD_SECRETS</variable>
514 </entry>
515 <button>
516 <input file icon="accessories-text-editor"></input>
517 <action type="lauch">leafpad $RSYNCD_SECRETS</action>
518 </button>
519 </hbox>
520 <hbox>
521 <button>
522 <label>Start</label>
523 <input file icon="forward"></input>
524 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)rsyncd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
525 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"rsyncd \1\"/" /etc/rcS.conf</action>
526 <action>/etc/init.d/rsyncd start</action>
527 </button>
528 <button>
529 <label>Stop</label>
530 <input file icon="stop"></input>
531 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)rsyncd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
532 <action>/etc/init.d/rsyncd stop</action>
533 </button>
534 </hbox>
535 </frame>
536 '
537 [ -x /usr/bin/rsync ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
538 tmp='<frame Lighttpd>
539 <hbox>
540 <text use-markup="true">
541 <label>"<b>Configuration :</b>"</label>
542 </text>
543 <entry editable="false">
544 <default>/etc/lighttpd/lighttpd.conf</default>
545 <variable>LIGHTTPD_CONF</variable>
546 </entry>
547 <button>
548 <input file icon="accessories-text-editor"></input>
549 <action type="lauch">leafpad $LIGHTTPD_CONF</action>
550 </button>
551 </hbox>
552 <hbox>
553 <button>
554 <label>Start</label>
555 <input file icon="forward"></input>
556 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)lighttpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
557 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"lighttpd \1\"/" /etc/rcS.conf</action>
558 <action>/etc/init.d/lighttpd start</action>
559 </button>
560 <button>
561 <label>Stop</label>
562 <input file icon="stop"></input>
563 <action>sed -i "s/RUN_DAEMONS=\"\(.*\)lighttpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
564 <action>/etc/init.d/lighttpd stop</action>
565 </button>
566 </hbox>
567 </frame>
568 '
569 [ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}"
570 tmp='
571 </notebook>
573 </notebook>
575 <hbox>
576 <button>
577 <label>Status</label>
578 <input file icon="network-wired"></input>
579 <action type="launch">IFCONFIG</action>
580 </button>
581 <button>
582 <input file icon="exit"></input>
583 <action type="exit">Exit</action>
584 </button>
585 </hbox>
587 </vbox>
588 </window>
589 '
590 NET_BOX="${NET_BOX}${tmp}"
592 export NET_BOX
594 # TODO: Servers/VNC(X11vnc) Servers/SMB(Samba)
595 # Modules(Network kernel modules) Firewall(Iptables) VPN(OpenVPN)
597 # Only root can configure network.
598 check_root
599 gtkdialog --center --program=NET_BOX
601 exit 0