|

OpenBSD Support Argentina es un portal de redifucion de los contenidos referidos a este sistema.
Categorias / Categories:
Inicio
Libros
Notas
Eventos
Scripts
Networking
Mirrors OpenBSD
Tutoriales
Videos
Graficas
Banners
Wallpapers
Fotos
Posters
Foro:
Encuentra mas contenido util aqui en el
Foro
Proyectos Asociados
Links
Contactos:
Ponte en contacto
Obtener OpenBSD
Nota: Si usted encuentra que alguna documentación es inservible, inexacta, obsoleta o simplemente esta mal, entonces su ayuda sera bienvenida para que esto sea mejor. Envíe su nuevo documento.
|
Portal de redifusion de sitios amigos de OpenBSD.
Y no se olvide de obtener su CD aquí para apoyar el proyecto!
Shell scripts / Script per ADSL con OpenBSD
#!/bin/sh
# Thanks to Peter Chiocchetti <girbal@tacheles.de>
# for this script
#
# connect to the (austrian telekom) adsl line
# return 0 on full run, 1 if already connected, 2 if ANT down
#
# - test whether pppd is running,
# - test whether pptp is running,
# - test wheter ANT is up,
# log failure
# - start pptp
# log success
# set this to the ip-address of the ANT
ANT=10.0.0.138
# set this to some nonexistant file
TMP=/tmp/prozesse
# use /dev/null to disable logging
LOG=/var/log/adsl
# use /dev/console to watch progress
OUT=/dev/null
#
# how are we ?
#
if [ ! -f /var/run/ppp0.pid ]; then
echo 'pppd is down' > $OUT
elif [ ! -S /var/run/pptp/$ANT ]; then
echo 'pptp is down' > $OUT
else # everything seems fine
exit 1
fi
echo -n 'testing ANT... ' > $OUT
ping -c 1 $ANT >/dev/null 2>&1
if [ "$?" != "0" ]; then
echo $ANT 'not responding, turn on the ANT.' > $OUT
# log this only once
tail -1 $LOG | grep ANT
if [ "$?" != "0" ]; then
echo -n "ANT down - " >> $LOG; date >> $LOG
fi
exit 2
fi
echo 'is fine.' > $OUT
#
# clean up !
#
if [ -f /var/run/ppp0.pid ]; then
echo -n 'shutting down pppd' > $OUT
kill `cat /var/run/ppp0.pid`
while [ -f /var/run/ppp0.pid ]; do
echo -n '.' > $OUT
sleep 1
done
echo '.' > $OUT
fi
if [ -S /var/run/pptp/$ANT ]; then
echo -n 'shutting down pptp' > $OUT
ps ax >$TMP
kill `awk '/pptp: call manager/ { print $1 } ' $TMP`
rm -f $TMP
while [ -S /var/run/pptp/$ANT ]; do
echo -n '.' > $OUT
sleep 1
done
echo '.' > $OUT
fi
#
# connect !
#
echo -n 'bringing up pptp... ' > $OUT
/usr/local/sbin/pptp $ANT >/dev/null 2>&1
wait
echo -n "PPTP up - " >> $LOG; date >> $LOG
echo 'done.' > $OUT
#eof
#by: http://www.openbeer.it
Back | Regresar
  OpenBSD Support Argentina se hostea en servidores OpenBSD
Copyright © 2004 - 2008 Alekid. All rights
reserved. Articles and comments are copyright their respective authors.
|