[pptp-server] Pptp client linux automatic

George Vieira georgev at citadelcomputer.com.au
Tue Nov 14 15:33:19 CST 2000


"sleep 3" is a bad way to do it as it may take a little longer to get an IP
and for the ppp to come up.

The way I did it is to use the `options.pptp` file and place 
iparams pptp
in it so when ppp starts, the /etc/ppp/ip-up and /etc/ppp/ip-up.loca script
gets executed and ppp passes
"pptp" as a parameter to the script.
All you have to so is check the parameter and if it's "pptp" then run some
routing tables and if not eg "ppp0" then continue with other things...

Another thing you should do is just check in /var/run/ppp1.pid "this is
usually where my pptp is running" and kill the pid for that... eg. kill `cat
/var/run/ppp1.pid`
This (for me) is a gracefull kill to the program and since I used "ipparam"
in the ppp options file, /etc/ppp/ip-down.local executes and can do whatever
it needs to do eg. restart pptp client or clean up the mess etc...

I have scripts here suited for RedHat should anybody be interested. Email me
without [pptp-server] in the subject line and I'll reply with the scripts.

thanks,
George Vieira
Network Administrator
http://www.citadelcomputer.com.au
PGP Fingerprint :	43DC 92AC 1A82 27B2 E97B  52F1 B60F 301A 38A9 A10C
PGP KeyID:		0x38A9A10C


-----Original Message-----
From: root [mailto:leuzim at pib.com.br]
Sent: Tuesday, November 14, 2000 11:38 PM
To: pptp-server at lists.schulte.org
Subject: [pptp-server] Pptp client linux automatic


Hey.. I make a little script to start and stop vpn client more easy.

pptp-up in /sbin/init.d

#!/bin/bash
/dir/vpn/pptp (ip server machine) 
/bin/sleep 3 #wait for ip adress to comeup 

pptp-down in /sbin/init.d

#!/bin/bash

killall -9 pppd # Killall pppds actives
killall -9 pptp #Killall pptps actives
rm -f /var/run/pptp/* #Remove any old dead PPTP session
rm -f /var/run/ppp* # Remove any old dead ppp session
ifconfig ppp0 down #Shutdown interface ppp

I using a Suse 6.4 and I make a rc file to bring up pptp client on boot
system
and view the status. You can reload the pptp more easy with rcpptp start and
rcpptp stop.

I make a script and put it on /sbin/init.d and link in /usr/sbin to use
rcpptp

#! /bin/sh
#file  /sbin/init.d/pptp

.. /etc/rc.config

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_PPTP=yes
test "$START_PPTP" = "yes" || exit 0


# The echo return value for success (defined in /etc/rc.config).
return=$rc_done
case "$1" in
    start)
        echo -n "Starting PPTP services:"
        startproc /sbin/init.d/pptp-up || return=$rc_done
        /bin/sleep 2
	echo -e "$return"
        ;;
    stop)
        echo -n "Shutting down PPTP services:"
        startproc /sbin/init.d/pptp-down || return=$rc_done 
        echo -e "$return"
        ;;
   restart|reload)
        $0 stop  &&  $0 start  || return=$rc_failed
        ;;
    status)
        echo -n "Checking for service pptp: "
        checkproc /dirvpnclient/pptp && echo -n "Vpn Up" || echo -n "Vpn
Down"
	echo -e "$return"	
	;;
   *)
        echo "Usage: $0 {start|stop|restart|reload|status}"
        exit 1 
esac

# Inform the caller not only verbosely and set an exit status.
test "$return" = "$rc_done" || exit 1
exit 0


[]s 
Wildcat
_______________________________________________
pptp-server maillist  -  pptp-server at lists.schulte.org
http://lists.schulte.org/mailman/listinfo/pptp-server
List services provided by www.schulteconsulting.com!



More information about the pptp-server mailing list