DebianLinux: ADSLPPPoE automatic redial Script

Source: Internet
Author: User
DebianLinux: ADSLPPPoE automatically resends the Script-Debian information of the Linux release technology. For more information, see the following. Yesterday morning, the Network (PPPoE) was disconnected and I was not aware of it. I was not at home all day. I had to connect back to check the information and found that the station was quite painful (I was too tired to remember the information, write it directly), and some things still need to be recorded in the head... XD

But I think it's still too hard to remember it with my head (my mind is not good), or I 'd better write a Script to do the reconnection. Orz ..

I found some articles and wanted to use them with ready-made programs. I didn't expect them to be very complicated (the whole page of the program is motionless). So after reading the article, I 'd just like to simply rewrite it.

The current test seems to be normal. (This Script is mainly used for Debian. For other systems, you only need to modify/usr/bin/pon and change it to the dial program used by your system ).

Reset the program and setup steps
The re-dial program is as follows: (vim/usr/bin/repppoe)

#! /Bin/bash
# If! Ping-c 3 168.95.1.1>/dev/null 2> & 1
# If! (Cat/proc/net/dev | grep ppp0)>/dev/null 2> & 1
If! Ping-c 3 tw.yahoo.com>/dev/null 2> & 1
Then
#/Usr/bin/poff
/Usr/bin/pon
Fi
Chmod + x/usr/bin/repppoe

Set crontab (set root crontab)

Crontab-e # Write the following
*/5 */usr/bin/repppoe

This is done ?? (There are only four lines of annotation program to be deducted. I was too lazy to write. XD even with four lines)

PS: if it is commented out in the program, you can think about the better solution. Remember 2> & 1, don't take it away (there will be endless emails)

/Usr/bin/poff indicates whether to disconnect and then dial when the network is disconnected. what I think is, if you do not get through it, you just need to dial it again. Otherwise, the system will be automatically disconnected after several seconds of ping failure.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.