US Robotics USR2410 Manuale di Installazione Pagina 62

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 67
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 61
58 6. Manual System Configuration
Diverting the boot scripts from init:
#!/bin/sh
mkdir /etc/network/init.d
PACKAGES="dns−clean fetchmail ippl lprng ntp ntpdate ppp scandetd ssh xinetd"
for p in $PACKAGES; do
dpkg−divert −−rename −−divert /etc/network/init.d/$p /etc/init.d/$p
update−rc.d $p remove
done
Nowwegotothe rc.d directories and create the newsymlinks by hand.
Creating the new startup/shutdown symlinks (example):
#> cd /etc/network/profiles
#> mkdir −p XXXX/rc.d YYYY/rc.d ZZZZ/rc.d
#> cd XXXX/rc.d
#> ln −s ../../../init.d/ssh S20ssh
#> ln −s ../../../init.d/ssh K20ssh
To integrate the VPN tunnel into this network profile management, we define a special network profile vpn,
which is not mapped to a scheme but can simply replace the current profile on a givenscheme.
To initialise the VPN tunnel and to switch to the corresponding profile, we use a simple script:
/usr/local/bin/vpn:
#!/bin/sh
prog=‘basename $0‘
test "X$SUPERCMD" = "X$prog" || exec /usr/bin/super $prog ${1+"$@"}
PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin"
ADDRESS=""
export DISPLAY=":0.0"
case "$1" in
up|start)
/usr/local/bin/xterm −geometry 156x26−0−0 −e vpnclient connect XXXX &
while [ "$ADDRESS" == "" ]; do
ADDRESS=‘vpnclient stat tunnel | grep "Client address" | awk ’{print $3}’‘
sleep 1
done
/usr/local/packages/network/bin/vpn−select
;;
down|stop)
kill ‘pidof vpnclient‘ &> /dev/null
kill ‘pidof vpn‘ &> /dev/null
/usr/local/packages/network/bin/vpn−deselect
;;
*)
echo "Usage: vpn [up|start|down|stop]"
;;
esac
Note: This script sets DISPLAY=:0.0" and assumes that root has access to this display.Note also: XXXX is the
name of the configured VPN profile,
We hav e to register this script with the super package by adding the following stanza to the configuration file:
/usr/local/bin/vpn:
vpn /usr/local/bin/vpn uid=root info="start/stop VPN" \
<user>
The twoscripts vpn-select and vpn-deselect have a similar functionality to profile-select and profile-deselect
whith the only exception that we don’thav e to map a profile but select the special profile vpn after the VPN tun-
nel has been established and revert to the previously active profile after the VPN tunnel has been closed.
Vedere la pagina 61
1 2 ... 57 58 59 60 61 62 63 64 65 66 67

Commenti su questo manuale

Nessun commento