Welcome! 登入 註冊
美寶首頁 美寶百科 美寶論壇 美寶落格 美寶地圖

Advanced

Change History

Message: [HOW TO] Auto Reconnect in ADSL/DSL with Script (Debian/SuSE)

Changed By: HP
Change Date: April 04, 2010 04:05AM

[HOW TO] Auto Reconnect in ADSL/DSL with Script (Debian/SuSE)
1. The Script: ((Just copy it and vi /usr/bin/repppoe)

<b>Script for Debian:</b>

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
<b>/usr/bin/pon ppp0</b>
fi

The command for starting network in Debian is <b>/usr/bin/pon</b> and <b>/sbin/ifup</b> for SUSE. The device name for DSL may be <b>dsl0</b> in SUSE.

<b>So, the script for SUSE may be is like:</b>

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
<b>/sbin/ifup dsl0</b>
fi

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You may set other numbers of minutes for it.

Reference (in Chinsesese):
1. <a href=http://plog.longwin.com.tw/programming/2007/08/24/adsl_repppoe_script_2007>Debian Linux: Auto Reconnecting Script in ADSL PPPoE</a> (2007)
2. <a href=http://linux.chinaunix.net/bbs/archiver/?tid-895502.html>Script to Auto Detect the down link of ADSL</a> (2007)
Changed By: HP
Change Date: April 04, 2010 04:01AM

[HOW TO] Auto Reconnect in ADSL/DSL with Script (Debian/SuSE)
1. The Script: (vi /usr/bin/repppoe)

<b>Script for Debian:</b>

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
/s<b>/usr/bin/ifuppon ppp0
</b>
fi

The command for starting command (ifup) network in Debian is <b>/usr/bin/pon</b>. and <b>/sbin/ifup</b> for SUSE. The device name for ifup DSL may be <b>dsl0</b> in SUSE.

<b>So, the script for SUSE may be like:</b>

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
<b>/sbin/ifup dsl0</b>
fi

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You may set other numbers of minutes for it.

Reference (in Chinses):
1. <a href=http://plog.longwin.com.tw/programming/2007/08/24/adsl_repppoe_script_2007>Debian Linux: Auto Reconnecting Script in ADSL PPPoE</a> (2007)
2. <a href=http://linux.chinaunix.net/bbs/archiver/?tid-895502.html>Script to Auto Detect the down link of ADSL</a> (2007)
Changed By: HP
Change Date: February 16, 2010 03:44AM

[HOW TO] Atuo Auto Reconnect in ADSL/DSL with Script (Debian/SuSE)
1. The Script: (vi /usr/bin/repppoe)

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
/sbin/ifup ppp0
fi

The starting command (ifup) in Debian is /usr/bin/pon. The device name for ifup may be dsl0 in SUSE.

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You set other numbers of minutes for it.

Reference (in Chinses):
1. Debian Linux: Auto Reconnecting Script in ADSL PPPoE (2007)
2. Script to Auto Detect the down link of ADSL (2007)
Changed By: HP
Change Date: February 16, 2010 02:23AM

The Way to [HOW TO] Atuo Reconnect in ADSL/DSL with Script (Debian/SuSE)
1. The Script: (vi /usr/bin/repppoe)

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
/sbin/ifup ppp0
fi

The starting command (ifup) in Debian is /usr/bin/pon. The device name for ifup may be dsl0 in SUSE.

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You set other numbers of minutes for it.

Reference (in Chinses):
1. Debian Linux: Auto Reconnecting Script in ADSL PPPoE (2007)
2. Script to Auto Detect the down link of ADSL (2007)
Changed By: HP
Change Date: February 15, 2010 03:10AM

The Way to Atuo Reconnect in ADSL/DSL with Script (Debian/SuSE)
1. The Script: (vi /usr/bin/repppoe)

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
/sbin/ifup ppp0
fi

The starting command (ifup) in Debian is /usr/bin/pon. The device name for ifup may be dsl0 in SUSE.

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You set other numbers of minutes for it.

Reference (in Chinses):
1. Debian Linux: Auto Reconnecting Script in ADSL PPPoE (2007)
2. Script to Auto Detect the down link of ADSL (2007)
Changed By: HP
Change Date: February 15, 2010 03:07AM

The Way to Atuo Reconnect in ADSL/DSL (Debian/SuSE)
1. The Script: (vi /usr/bin/repppoe)

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
/sbin/ifup ppp0
fi

The starting command (ifup) in Debian is /usr/bin/pon. The device name for ifup may be dsl0 in SUSE.

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You set other numbers of minutes for it.

Reference (in Chinses):
1. Debian Linux: Auto Reconnecting Script in ADSL PPPoE (2007)
2. Script to Auto Detect the down link of ADSL (2007)

Original Message

作者: HP
Date: February 15, 2010 03:07AM

The Way to Atuo Reconnect in ADSL/DSL
1. The Script: (vi /usr/bin/repppoe)

#!/bin/bash
if !ping -c 3 www.google.com > /dev/null 2>&1
then
#/usr/bin/poff
#/usr/bin/pon dsl-provider
/sbin/ifup ppp0
fi

The starting command (ifup) in Debian is /usr/bin/pon. The device name for ifup may be dsl0 in SUSE.

2. chmod +x /usr/bin/repppoe

3. crontab (as root)

Shell> crontab -e
*/5 * * * * /usr/bin/repppoe

It means to check the script every 5 minutes. You set other numbers of minutes for it.

Reference (in Chinses):
1. Debian Linux: Auto Reconnecting Script in ADSL PPPoE (2007)
2. Script to Auto Detect the down link of ADSL (2007)