On Demand VPN

Matt Graham danceswithcrows at usa.net
Sun Sep 25 15:27:18 MST 2011


From: "Bryan O'Neal" <Bryan.ONeal at TheONealAndAssociates.com>
> binary it is likly tamper resistant. And if your companies policy is
> route all tragic through them

I *LIKE* that typo.

I used to have a similar situation to the original post.  I fixed it by
finding out that when my laptop resumed from suspend-to-RAM, it always called
/etc/acpi/default.sh.[0]  Since default.sh is a pretty standard shell script,
it was easy to modify so that it'd check to see which NIC was connected with
mii-tool, and run appropriate commands.  You'd have to do something different,
though, since the ACPI scripts run before anything has managed to run dhcpcd. 
So:  fork/exec something that waits 10 seconds, then pipes ifconfig through
grep, then either starts the VPN or not based on what it gets back?  Sounds
doable, depending on the VPN client in use.

[0] I don't know why, but closing the lid generates a "button lid" event,
opening it generates a "processor processor" event.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



More information about the PLUG-discuss mailing list