[lug] pptp with init script help

Paul Nowosielski paulnowosielski at yahoo.com
Sun Dec 12 12:55:34 MST 2010


Dear All,

I'm trying to get a system to initiate a pptp tunnel
on boot.

I wrote a simple start up script. If I run it from the command line
it works fine but it fails if its run via the init script.

I also have a cron job that checks the vpn.
If the vpn is not up it should start the vpn tunnel by calling the script 
below.
Once again, it works if I run it manually but does not work if
the cron daemon calls it.

Can anyone give me any suggestions to
solve this please.

Thank you,

Paul

#  start tunnel called by init script

#!/bin/sh

# load mods for pptp

echo "Load the pptp modules..."

/sbin/modprobe ppp_mppe
/sbin/modprobe ppp_async
/sbin/modprobe ppp_generic

# dial

/bin/echo "Calling crm_ca..."

/usr/sbin/pppd call crm_ca


# set the netmask 

/bin/sleep 15 

/bin/echo "Setting mask..."

/sbin/ifconfig ppp0 netmask 255.255.255.0

#





# check tunnel cron script

#!/bin/sh



if /sbin/ifconfig |grep ppp -c &> /dev/null

  then echo 

  else

  /root/scripts/tunnel_crm_ca.sh

fi





More information about the LUG mailing list