Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[debutant] Connexion Internet

3 réponses
Avatar
matt
Bonjour,

Je suis avec un Debian 3.1 et je me connecte a Internet via un shell de
ce style :

#!/bin/sh

case "$1" in
start)

echo 'connexion en cours ...'
modem_run -k -f connexion.sh
pppd call wanadoo
echo 'connexion etablie'
;;

stop)
echo "comment faire ???"
exit 1
;;

*)
echo "Usage : wanadoo {start|stop}}"
exit 1
;;

esac

exit 0

Pour la connexion, ca marche impeccable mais
1) comment faire pour stopper ma connexion propement ?
2) Comment faire pour savoir si ma connexion est active ?
(j'utilise un truc comme ca : ps -A | grep pppd)

Merci pour vos réponses,

Matt...

3 réponses

Avatar
oli-cla
Bonjour,

Je suis avec un Debian 3.1 et je me connecte a Internet via un shell de
ce style :

#!/bin/sh

case "$1" in
start)

echo 'connexion en cours ...'
modem_run -k -f connexion.sh
pppd call wanadoo
echo 'connexion etablie'
;;

stop)
# Determine le peripherique a stopper.

#
if [ "$1" = "" ]; then
DEVICE=ppp0
else
DEVICE=$1
fi

######################################################################
#
# si le processus ppp0 est present alors le programme tourne .
arretons le.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
exit 1
;;

*)
echo "Usage : wanadoo {start|stop}}"
exit 1
;;

esac

exit 0

Pour la connexion, ca marche impeccable mais
1) comment faire pour stopper ma connexion propement ?
2) Comment faire pour savoir si ma connexion est active ?
(j'utilise un truc comme ca : ps -A | grep pppd)

Merci pour vos réponses,

Matt...


Salut ,

un truc dans ce genre devrait suffire
bon courage,

Avatar
oli-cla
Bonjour,

Je suis avec un Debian 3.1 et je me connecte a Internet via un shell de
ce style :

#!/bin/sh

case "$1" in
start)

echo 'connexion en cours ...'
modem_run -k -f connexion.sh
pppd call wanadoo
echo 'connexion etablie'
;;

stop)
# Determine le peripherique a stopper.

DEVICE=ppp0

######################################################################
#
# si le processus ppp0 est present alors le programme tourne .
arretons le.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
exit 1
;;
*)
echo "Usage : wanadoo {start|stop}}"
exit 1
;;

esac

exit 0

Pour la connexion, ca marche impeccable mais
1) comment faire pour stopper ma connexion propement ?
2) Comment faire pour savoir si ma connexion est active ?
(j'utilise un truc comme ca : ps -A | grep pppd)

Merci pour vos réponses,

Matt...


Petite erreur, comme ca celà devrait mieux aller

Salut,

Avatar
matt
stop)


# Determine le peripherique a stopper.
DEVICE=ppp0

######################################################################
#
# si le processus ppp0 est present alors le programme tourne .
arretons le.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
exit 1
;;

Ok, je teste ca ....


Petite erreur, comme ca celà devrait mieux aller



et merci pour la réponse rapide,

Matt...