Do you think it would be possible to run a script when a VPN in
instance is started?
Regards,
-Roy
Yes. You could watch for the network interface coming up, or you could
watch for any IP changes and check if the relevant interface is there.
>
> Regards,
> -Roy
>
> --
> You received this message because you are subscribed to the Google Groups "PyMacAdmin" group.
> To post to this group, send email to pymac...@googlegroups.com.
> To unsubscribe from this group, send email to pymacadmin+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pymacadmin?hl=en.
>
>
<key>SystemConfiguration</key>
<dict>
<key>State:/Network/Global/IPv4</key>
<dict>
<key>method</key>
<array>
<string>NetworkStateChange</string>
<string>OnNetworkStateChange</string>
</array>
</dict>
</dict>
and then have:
/Library/Application Support/crankd/NetworkStateChange.py
that includes:
class NetworkStateChange(object):
"""class to be triggered on network state changes."""
.....
def OnNetworkStateChange(self, *unused_args, **unused_kwargs):
"""entry point for network state changes, triggered by crankd."""
.....
We found here that we were sharing lots of utility methods between
various crankd objects, so we have a common set of python libraries
that get included by our crankd modules.
-Greg
To unsubscribe from this group, send email to pymacadmin+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pymacadmin?hl=en.
I keep wishing that too :(
My contributions to all these things have gone rapidly down hill since
I came to a new arrangement with my family about computer usage when
at home :)
-Greg
http://www.diveintopython.org :)
My family's coming to a new arrangement with me in a few months.
On-topic, another way you might approach running a script when a VPN
connection is active is to use the facilities of the VPN client itself.
If you have the Cisco AnyConnect client, for example, OnConnect and
DisConnect scripts are an option; they trigger at the connect and disconnect
events, as you'd expect. I can't speak from experience using them, yet, but
they're documented in the client admin guide. Apparently they can be in any
language the client OS understands, and can be downloaded from a Cisco ASA
during its profile policy refresh. Although you can only run one script at
each event, the single script can call others, so it ought to be familiar to
those of us used to Login/LogoutHooks.
--
Jeremy
--