Skip to main content

:Linux: ppp0 auto reconnect

greetings
guys, I have ADSL through ppp0, How to set it to auto reconnect when
disconnected..
Thanks in advance


This script should do what you want.

============= reconnect_modem.sh =============
#!/bin/sh
#
# Script to check if modem is disconnected & try reconnecting
# Graham Smith - 01/02/2004
#
# set -x
result=$(/usr/bin/cinternet -i dsl0 -s | /usr/bin/grep disconnect)
#Checks the status of device dsl0 'disconnect'
if [ -n "$result" ]
then
/usr/bin/cinternet -i dsl0 -A #Start the interface.
sleep 10
else #The interface is up - Just exit
exit 0
fi
==================================

Just add the following line to your crontab, replacing with the path
you installed the script in. It checks to see if the modem has been disc
every 3 minutes.

4-59/3 * * * * /reconnect_modem.sh 2>&1 /dev/null

--
Regards,

Graham Smith


Thank you Graham!
& Thank you basem Narmoug

Comments

Popular posts from this blog

اهم التطورات العلمية في العام ٢٠١٩

Dear Microsoft : It's over. Our relationship just hasn't been working for a while, and now, this is it. I'm leaving you for another Operating system. I know this isn't a good time--you're down with yet another virus. I do hope you feel better soon--really, I do--but I, too, have to move on with my life. Fact is, in the entire time I've known you, you seem to always have a virus or an occasional worm. You should really see a doctor. That said, I just can't continue with this relationship any longer. I know you say you'll fix things, that next time it'll go better--but that's what you said the last time--and the time before that. Each time I believed you. Well, not any longer. You cheater! The truth is there's nothing more you can say to make things better. I know about your secret marriage to patent. You say you two are not seeing each other anymore, but I just don't believe it. You say you can live without patent, and I've heard that

10 things Dorothée Loorbach learned after losing a lot of money

Dorothée isn't just sharing her life changing experience with work and money, and sharing the following tips which won't make much sense without listening to the tips in her own words Money is important Money equals time Money equals value What people say doesn't matter What people say matters most when people is you! It's really simple - spend less, earn more, invest wisely and value yourself. It's not that easy Being broke sucks Stay Broke - be present in your own life Money isn't important https://youtu.be/_8l2egORXGA