Slackware pppoe autoreconnect

For a long time I had a bad problem on one server, He fell adapter pppoe not picking on Sam. The decision is only trevialno as usual was a matter of laziness and a few magic moves 😀 Lit the following script in crontab I kioito-a to check in 5 minutes

#!/bin/bash

PPP_DEV=$(ifconfig | grep -c ppp)

if [ $PPP_DEV -gt 0 ]
then
 echo -e "\n PPPoE still connected \n"
else
 echo -e "\n PPPoE is dropped \n"

 if  ! ping -c 2 -q 'abv.bg' &> /dev/null
 then
    /usr/sbin/pppoe-stop &
    sleep 4
 fi

 /usr/sbin/pppoe-start &
fi

The script is completely spartan but it does the job. Otherwise slackware itself generally has an option in the konfa-pppoe to it rekonektva only in the disintegration of the line but a chance.

2 comments

  1. Предложение за лека оптимизациика.
    if ! `grep ppp /proc/net/dev &>/dev/null` || \
    ! `ping -c 2 -q abv.bg &>/dev/null` ; then
    echo “PPPoE Not working.”
    fi

    ne sym siguren dali ne slojih edno otrivanie v poveche , ama shte siprolichi 😉

leave a reply

Your email address will not be published. Required fields are marked *

anti SPAM *