slitaz-tools rev 374

netbox: add easyvpn support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 12 14:24:49 2009 +0200 (2009-08-12)
parents 6e7a9c7011ae
children e6024fd272d4
files tinyutils/netbox
line diff
     1.1 --- a/tinyutils/netbox	Wed Aug 12 13:22:54 2009 +0200
     1.2 +++ b/tinyutils/netbox	Wed Aug 12 14:24:49 2009 +0200
     1.3 @@ -669,6 +669,7 @@
     1.4  	<hbox>
     1.5  $(helpbutton pppd 80x30)
     1.6  $(manbutton 8 pppd)
     1.7 +$(webbutton ppp)
     1.8  		<button>
     1.9  			<input file icon="accessories-text-editor"></input>
    1.10  			<label>Tune</label>
    1.11 @@ -736,6 +737,7 @@
    1.12  	<hbox>
    1.13  $(helpbutton pppd 80x30)
    1.14  $(manbutton 8 pppd)
    1.15 +$(webbutton ppp)
    1.16  		<button>
    1.17  			<input file icon="accessories-text-editor"></input>
    1.18  			<label>Tune</label>
    1.19 @@ -971,6 +973,7 @@
    1.20  	  <label>Options</label>
    1.21  	  <action type="lauch">leafpad /etc/ppp/options.pptp</action>
    1.22  	</button>
    1.23 +$(webbutton pptpclient)
    1.24          <button>
    1.25            <input file icon="forward"></input>
    1.26  	  <label>Connect</label>
    1.27 @@ -993,14 +996,50 @@
    1.28  EOT
    1.29  }
    1.30  
    1.31 +#
    1.32 +# Cisco EasyVPN
    1.33 +#
    1.34 +tab_easyvpn()
    1.35 +{
    1.36 +cat <<EOT
    1.37 +    <frame Cisco EasyVPN>
    1.38 +<hbox>
    1.39 +	<text use-markup="true">
    1.40 +		<label>"<b>VPNC_OPTIONS</b>"</label>
    1.41 +	</text>
    1.42 +	<entry editable="false">
    1.43 +EOT
    1.44 +[ -n "$VPNC_OPTIONS" ] && cat << EOT
    1.45 +		<default>$tmp</default>
    1.46 +EOT
    1.47 +	cat << EOT
    1.48 +		<variable>VPNC_OPTS</variable>
    1.49 +	</entry>
    1.50 +$(helpbutton vpnc 80x30)
    1.51 +<button>
    1.52 +	<input file icon="help"></input>
    1.53 +	<label>more</label>
    1.54 +	<action>$xterm -geometry 80x40 -title "vpnc help (q to quit)" -e "$(which vpnc) --long-help 2>&1 | less"</action>
    1.55 +</button>
    1.56 +$(editbutton /etc/daemons.conf)
    1.57 +</hbox>
    1.58 +$(configfile /etc/vpnc/default.conf VPNC_CONF)
    1.59 +$(datafile "/etc/vpnc/vpnc-script" VPNC_SCRIPT 'Script:')
    1.60 +      <hbox>
    1.61 +	$(startstopdaemon vpnc)
    1.62 +      </hbox>
    1.63 +     </frame>
    1.64 +EOT
    1.65 +}
    1.66 +
    1.67  data_vpn()
    1.68  {
    1.69  cat <<EOT
    1.70  $([ -x /usr/sbin/dropbear -o -x /usr/sbin/sshd ] && echo "pppd" ||
    1.71  echo "#")   PPP/SSH       tab_sshppp
    1.72  pptp        PPTP          tab_pptp
    1.73 +vpnc        EasyVPN       tab_easyvpn
    1.74  #TODO openvpn     OpenVPN       tab_openvpn
    1.75 -#TODO vpnc        EasyVPN       tab_easyvpn
    1.76  EOT
    1.77  }
    1.78  
    1.79 @@ -1444,8 +1483,8 @@
    1.80  {
    1.81  local $pxe
    1.82  pxe="#"
    1.83 -[ -x /usr/sbin/dnsmasq ] && pxe="inetd"
    1.84  [ -x /usr/bin/tftpd -a -x /usr/sbin/udhcpd ] && pxe="inetd"
    1.85 +[ -x /usr/sbin/dnsmasq ] && pxe="true"
    1.86  [ -f /usr/share/boot/pxelinux.0.lzma ] || pxe="#"
    1.87  cat <<EOT
    1.88  $([ -x /usr/sbin/dropbear -o -x /usr/sbin/sshd ] && echo "true" ||
    1.89 @@ -1488,6 +1527,7 @@
    1.90        <hbox>
    1.91  $(helpbutton iptables 80x30)
    1.92  $(manbutton 8 iptables)
    1.93 +$(webbutton iptables)
    1.94          <button>
    1.95            <label>Load</label>
    1.96            <input file icon="reload"></input>
    1.97 @@ -1728,6 +1768,9 @@
    1.98  # client	server	secret			IP addresses
    1.99  _EOT_
   1.100  fi
   1.101 +cat > toto <<EOT
   1.102 +$NET_BOX
   1.103 +EOT
   1.104  gtkdialog --center --program=NET_BOX | grep -a 'EXIT="restart"' && continue
   1.105  exit 0
   1.106  done