slitaz-tools rev 215

netbox: add zcip
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 23 15:16:13 2008 +0000 (2008-06-23)
parents 33e84b0821de
children 939d1e5cfa3d
files tinyutils/netbox
line diff
     1.1 --- a/tinyutils/netbox	Wed Jun 18 21:25:51 2008 +0000
     1.2 +++ b/tinyutils/netbox	Mon Jun 23 15:16:13 2008 +0000
     1.3 @@ -587,6 +587,7 @@
     1.4  tmp=''
     1.5  [ -x /usr/sbin/dropbear ] && NET_BOX="${NET_BOX}${tmp}SSH"   && tmp='|'
     1.6  [ -x /usr/sbin/inetd    ] && NET_BOX="${NET_BOX}${tmp}INETD" && tmp='|'
     1.7 +[ -x /sbin/zcip         ] && NET_BOX="${NET_BOX}${tmp}ZEROCONF" && tmp='|'
     1.8  [ -x /usr/sbin/udhcpd   ] && NET_BOX="${NET_BOX}${tmp}DHCP"  && tmp='|'
     1.9  [ -f /usr/share/boot/pxelinux.0.lzma -a -x /usr/bin/tftpd -a \
    1.10    -x /usr/sbin/inetd -a -x /usr/sbin/udhcpd ] \
    1.11 @@ -737,6 +738,64 @@
    1.12       </frame>
    1.13  '
    1.14  [ -x /usr/sbin/inetd ] && NET_BOX="${NET_BOX}${tmp}${tmp2}"
    1.15 +if [ -x /sbin/zcip -a -z "$ZCIP_OPTS" ]; then
    1.16 +	ZCIP_OPTS="eth0 /etc/zcip.script"
    1.17 +	cat >> /etc/daemons.conf <<EOT
    1.18 +# ZeroConf options
    1.19 +ZCIP_OPTS="$ZCIP_OPTS"
    1.20 +
    1.21 +EOT
    1.22 +fi
    1.23 +tmp='<frame Zcip>
    1.24 +      <hbox>
    1.25 +        <text use-markup="true">
    1.26 +          <label>"<b>ZCIP_OPTIONS</b>"</label>
    1.27 +        </text>
    1.28 +        <entry editable="false">'
    1.29 +[ -n "$ZCIP_OPTS" ] && tmp="$tmp<default>$ZCIP_OPTS</default>"
    1.30 +tmp2='
    1.31 +          <variable>CZIP_OPTS</variable>
    1.32 +        </entry>
    1.33 +        <button>
    1.34 +          <input file icon="help"></input>
    1.35 +	  <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -geometry 60x14 -title "zcip help" -e "zcip --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
    1.36 +        </button>
    1.37 +        <button>
    1.38 +          <input file icon="accessories-text-editor"></input>
    1.39 +          <action type="lauch">leafpad /etc/daemons.conf</action>
    1.40 +        </button>
    1.41 +      </hbox>
    1.42 +      <hbox>
    1.43 +        <text use-markup="true">
    1.44 +          <label>"<b>Script :</b>"</label>
    1.45 +        </text>
    1.46 +        <entry editable="false">
    1.47 +          <default>/etc/zcip.script</default>
    1.48 +          <variable>CZIP_SCRIPT</variable>
    1.49 +        </entry>
    1.50 +        <button>
    1.51 +          <input file icon="accessories-text-editor"></input>
    1.52 +          <action type="lauch">leafpad $CZIP_SCRIPT</action>
    1.53 +        </button>
    1.54 +      </hbox>
    1.55 +      <hbox>
    1.56 +        <button>
    1.57 +          <label>Start</label>
    1.58 +          <input file icon="forward"></input>
    1.59 +          <action>sed -i "s/RUN_DAEMONS=\"\(.*\)zcip \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
    1.60 +          <action>sed -i "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"zcip \1\"/" /etc/rcS.conf</action>
    1.61 +          <action>/etc/init.d/zcip start</action>
    1.62 +        </button>
    1.63 +        <button>
    1.64 +          <label>Stop</label>
    1.65 +          <input file icon="stop"></input>
    1.66 +          <action>sed -i "s/RUN_DAEMONS=\"\(.*\)zcip \?\(.*\)\"/RUN_DAEMONS=\"\1\2\"/" /etc/rcS.conf</action>
    1.67 +          <action>/etc/init.d/zcip stop</action>
    1.68 +        </button>
    1.69 +      </hbox>
    1.70 +     </frame>
    1.71 +'
    1.72 +[ -x /sbin/zcip ] && NET_BOX="${NET_BOX}$tmp$tmp2"
    1.73  tmp='<frame Dhcpd>
    1.74        <hbox>
    1.75          <text use-markup="true">
    1.76 @@ -770,6 +829,19 @@
    1.77          </button>
    1.78        </hbox>
    1.79        <hbox>
    1.80 +        <text use-markup="true">
    1.81 +          <label>"<b>Script :</b>"</label>
    1.82 +        </text>
    1.83 +        <entry editable="false">
    1.84 +          <default>/usr/share/udhcpc/default.script</default>
    1.85 +          <variable>UDHCPD_SCRIPT</variable>
    1.86 +        </entry>
    1.87 +        <button>
    1.88 +          <input file icon="accessories-text-editor"></input>
    1.89 +          <action type="lauch">leafpad $UDHCPD_SCRIPT</action>
    1.90 +        </button>
    1.91 +      </hbox>
    1.92 +      <hbox>
    1.93          <button>
    1.94            <label>Start</label>
    1.95            <input file icon="forward"></input>