[pptp-server] PPTP Client redialer script?
Ron Cresswell
cresswell at comcen.com.au
Mon Nov 6 19:16:32 CST 2000
Hi Boris,
I started one, but so far haven't figured out how to get the server end
to drop it's connection so that the client can reconnect - I'm using a
single fixed pair of IP addresses and if the server doesn't drop it's
connection, the address that the client tries to reconnect to is in use.
Anyway, here's what I was going to use at the client end (run the script
once per minute as a cron job - it checks that the connection is up, and
if not it reinitiates and starts a new connection):
-----cut here-------
#!/bin/bash
ans1=`ps -ef | grep pptp | grep -v grep | grep -v query | wc -l |
/bin/awk '{print $1}'`
tim=`date | awk '{print $4}'`
dat=`date | awk '{print $1 " " $2 " " $3 }'`
if [ "$ans1" = "0" ]
then
echo "pptp is down!"
echo "cleaning up pptp"
ifconfig ppp0 down
kill -HUP `cat /var/run/ppp0.pid`
rm /var/run/pptp/*
echo "re-initiating link on $dat at $tim"
/usr/local/bin/pptp-up
fi
-----cut here-------
Cheers
Ron
Boris Reisig wrote:
> I finally got the PPTP client working. I had to add my ip on client to
> the default route and I could now ping both sides of the network. But
> the question I have is has anyone wrote a pptp bash script to keep the
> connection up 24/7? Im looking to get my connection up 24/7 and if it
> disconnects I want it to reconnect immediately. Does anyone have any
> kind of script to do that?
>
More information about the pptp-server
mailing list