slitaz-tools rev 151
netbox: tftpd started by inetd
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Apr 19 19:38:33 2008 +0000 (2008-04-19) |
parents | 32debc9dd878 |
children | c08ea2bfd42d |
files | tinyutils/netbox |
line diff
1.1 --- a/tinyutils/netbox Fri Apr 18 17:48:36 2008 +0200 1.2 +++ b/tinyutils/netbox Sat Apr 19 19:38:33 2008 +0000 1.3 @@ -42,7 +42,7 @@ 1.4 </text> 1.5 <frame Servers> 1.6 <text wrap="false" width-chars="58"> 1.7 - <input>for i in dropbear tftpd udhcpd dnsd rsync lighttpd ; do ps w | grep $i | grep -v grep; done</input> 1.8 + <input>for i in dropbear inetd udhcpd dnsd rsync lighttpd ; do ps w | grep $i | grep -v grep; done</input> 1.9 </text> 1.10 </frame> 1.11 <hbox> 1.12 @@ -67,13 +67,13 @@ 1.13 <b>SliTaz - Netbox</b>" 1.14 </label> 1.15 </text> 1.16 - <text wrap="true" width-chars="48"> 1.17 + <text wrap="true" width-chars="44"> 1.18 <label> 1.19 " 1.20 -Manage network connections getting dynamic IP by DHCP 1.21 -or static IP, and setup servers. Netbox can start or stop 1.22 -networking, configure network interfaces or directly edit 1.23 -configuration files. 1.24 +Manage network connections getting dynamic IP 1.25 +by DHCP or static IP, and setup servers. 1.26 +Netbox can start or stop networking, configure 1.27 +network interfaces or directly edit files. 1.28 " 1.29 </label> 1.30 </text> 1.31 @@ -244,10 +244,11 @@ 1.32 NET_BOX="$NET_BOX$tmp" 1.33 tmp='' 1.34 [ -x /usr/sbin/dropbear ] && NET_BOX="${NET_BOX}${tmp}SSH" && tmp='|' 1.35 -[ -x /usr/bin/tftpd ] && NET_BOX="${NET_BOX}${tmp}TFTP" && tmp='|' 1.36 +[ -x /usr/sbin/inetd ] && NET_BOX="${NET_BOX}${tmp}INETD" && tmp='|' 1.37 [ -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}DHCP" && tmp='|' 1.38 [ -f /usr/share/boot/pxelinux.0.lzma -a -x /usr/bin/tftpd -a \ 1.39 - -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}PXE" && tmp='|' 1.40 + -x /usr/sbin/inetd -a -x /usr/sbin/udhcpd ] \ 1.41 + && NET_BOX="${NET_BOX}${tmp}PXE" && tmp='|' 1.42 [ -x /usr/sbin/dnsd ] && NET_BOX="${NET_BOX}${tmp}DNS" && tmp='|' 1.43 [ -x /usr/bin/rsync ] && NET_BOX="${NET_BOX}${tmp}RSYNC" && tmp='|' 1.44 [ -x /usr/sbin/lighttpd ] && NET_BOX="${NET_BOX}${tmp}HTTP" && tmp='|' 1.45 @@ -310,26 +311,19 @@ 1.46 </frame> 1.47 ' 1.48 [ -x /usr/sbin/dropbear ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 1.49 -set -- $TFTPD_OPTIONS 1.50 -TFTPD_OPTS="" 1.51 -while [ -n "$2" ]; do 1.52 - TFTPD_OPTS="$TFTPD_OPTS $1" 1.53 - shift 1.54 -done 1.55 -TFTPD_ROOT="$1" 1.56 -tmp='<frame Tftpd> 1.57 +tmp='<frame Inetd> 1.58 <hbox> 1.59 <text use-markup="true"> 1.60 - <label>"<b>TFTPD_OPTIONS</b>"</label> 1.61 + <label>"<b>INETD_OPTIONS</b>"</label> 1.62 </text> 1.63 <entry editable="false">' 1.64 -[ -n "$TFTPD_OPTS" ] && tmp="$tmp<default>$TFTPD_OPTS</default>" 1.65 +[ -n "$INETD_OPTS" ] && tmp="$tmp<default>$INETD_OPTS</default>" 1.66 tmp2=' 1.67 - <variable>TFTPD_OPTS</variable> 1.68 + <variable>INETD_OPTS</variable> 1.69 </entry> 1.70 <button> 1.71 <input file icon="help"></input> 1.72 - <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> 1.73 + <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 60x14 -title "inetd help" -e "inetd --help ; echo -e \"----\nENTER to continue...\" && read close"</action> 1.74 </button> 1.75 <button> 1.76 <input file icon="accessories-text-editor"></input> 1.77 @@ -338,33 +332,49 @@ 1.78 </hbox> 1.79 <hbox> 1.80 <text use-markup="true"> 1.81 - <label>"<b>Root path :</b>"</label> 1.82 + <label>"<b>Configuration :</b>"</label> 1.83 </text> 1.84 - <entry editable="false">' 1.85 -tmp="$tmp$tmp2" 1.86 -[ -n "$TFTPD_ROOT" ] && tmp="$tmp<default>$TFTPD_ROOT</default>" 1.87 -tmp2=' 1.88 - <variable>TFTPD_ROOT</variable> 1.89 + <entry editable="false"> 1.90 + <default>/etc/inetd.conf</default> 1.91 + <variable>INETD_CONF</variable> 1.92 </entry> 1.93 + <button> 1.94 + <input file icon="accessories-text-editor"></input> 1.95 + <action type="lauch">leafpad $INETD_CONF</action> 1.96 + </button> 1.97 </hbox> 1.98 <hbox> 1.99 +' 1.100 +tmp="$tmp$tmp2" 1.101 +for i in $(grep bin /etc/inetd.conf | awk '{ print $6}'); do 1.102 + i=$(basename $i) 1.103 +tmp2=" 1.104 + <button> 1.105 + <input file icon=\"help\"></input> 1.106 + <label>$i</label> 1.107 + <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 60x19 -title \"$i help\" -e \"$i --help ; echo -e \\\"----\nENTER to continue...\\\" && read close\"</action> 1.108 + </button> 1.109 +" 1.110 + tmp="$tmp$tmp2" 1.111 +done 1.112 +tmp2=' 1.113 <button> 1.114 <label>Start</label> 1.115 <input file icon="forward"></input> 1.116 - <action>sed -i "s/RUN_DAEMONS=\"\(.*\)tftpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action> 1.117 - <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"tftpd \1\"/" /etc/rcS.conf</action> 1.118 - <action>/etc/init.d/tftpd start</action> 1.119 + <action>sed -i "s/RUN_DAEMONS=\"\(.*\)inetd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action> 1.120 + <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"inetd \1\"/" /etc/rcS.conf</action> 1.121 + <action>/etc/init.d/inetd start</action> 1.122 </button> 1.123 <button> 1.124 <label>Stop</label> 1.125 <input file icon="stop"></input> 1.126 - <action>sed -i "s/RUN_DAEMONS=\"\(.*\)tftpd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action> 1.127 - <action>/etc/init.d/tftpd start</action> 1.128 + <action>sed -i "s/RUN_DAEMONS=\"\(.*\)inetd \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action> 1.129 + <action>/etc/init.d/inetd stop</action> 1.130 </button> 1.131 </hbox> 1.132 </frame> 1.133 ' 1.134 -[ -x /usr/bin/tftpd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 1.135 +[ -x /usr/sbin/inetd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}" 1.136 tmp='<frame Dhcpd> 1.137 <hbox> 1.138 <text use-markup="true"> 1.139 @@ -401,7 +411,7 @@ 1.140 <hbox> 1.141 <text wrap="true"> 1.142 <label> 1.143 -"Tftpd and Dhcpd must be lauched to start the PXE service." 1.144 +"Launch Dhcpd and Inetd with Tftpd to start the PXE service." 1.145 </label> 1.146 </text> 1.147 </hbox> 1.148 @@ -415,17 +425,17 @@ 1.149 </entry> 1.150 <button> 1.151 <input file icon="accessories-text-editor"></input> 1.152 - <action>dir=$(dirname $TFTPD_ROOT/$PXE_CONF); [ -d $dir ] || mkdir -p $dir</action> 1.153 - <action>lzma d /usr/share/boot/pxelinux.0.lzma $TFTPD_ROOT/pxelinux.0</action> 1.154 + <action>dir=$(dirname /boot/$PXE_CONF); [ -d $dir ] || mkdir -p $dir</action> 1.155 + <action>lzma d /usr/share/boot/pxelinux.0.lzma /boot/pxelinux.0</action> 1.156 <action>grep "^option bootfile=pxelinux.0" $UDHCPD_CONF || echo "option bootfile=pxelinux.0" >> $UDHCPD_CONF</action> 1.157 - <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> 1.158 - <action type="lauch">leafpad $TFTPD_ROOT/$PXE_CONF</action> 1.159 + <action>[ -f /boot/$PXE_CONF ] || echo -e "label slitaz\n\tkernel bzImage\n\tappend initrd=rootfs.gz rw root=/dev/null vga=normal" > /boot/$PXE_CONF</action> 1.160 + <action type="lauch">leafpad /boot/$PXE_CONF</action> 1.161 </button> 1.162 </hbox> 1.163 </frame> 1.164 ' 1.165 [ -f /usr/share/boot/pxelinux.0.lzma -a -x /usr/bin/tftpd -a \ 1.166 - -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}" 1.167 + -x /usr/sbin/inetd -a -x /usr/sbin/udhcpd ] && NET_BOX="${NET_BOX}${tmp}" 1.168 tmp='<frame Dnsd> 1.169 <hbox> 1.170 <text use-markup="true"> 1.171 @@ -644,6 +654,20 @@ 1.172 <frame Ether-wake> 1.173 <hbox> 1.174 <text use-markup="true"> 1.175 + <label>"<b>Machines :</b>"</label> 1.176 + </text> 1.177 + <entry editable="false"> 1.178 + <default>/etc/ethers</default> 1.179 + <variable>ETHERS</variable> 1.180 + </entry> 1.181 + <button> 1.182 + <input file icon="accessories-text-editor"></input> 1.183 + <action>[ -s $ETHERS ] || echo "#00:01:02:03:04:05 mystation" >$ETHERS</action> 1.184 + <action type="lauch">leafpad $ETHERS</action> 1.185 + </button> 1.186 + </hbox> 1.187 + <hbox> 1.188 + <text use-markup="true"> 1.189 <label>"<b>Options : </b>"</label> 1.190 </text> 1.191 <entry editable="false">