• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detect network interface changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detect network interface changes


  • Subject: Re: Detect network interface changes
  • From: Josh Graessley <email@hidden>
  • Date: Sun, 19 Jul 2009 08:47:37 -0700


No. Don't look at the preferences plist. That file will only change when the settings change, not when the network state changes. Use SystemConfiguration.framework. There are APIs to watch for changes in the dynamic store. scutil is a command line tool you may use to explore the dynamic store on your system.

Sent from my iPhone

On Jul 19, 2009, at 8:06, Ian Mark Salvame <email@hidden> wrote:


> Hello,
>
>> Any suggestions how to do this?
>> It seems that there's no way of doing this through launchd.
>
>There is, you have to watch specifically the file
>/Library/Preferences/SystemConfiguration/preferences.plist via LaunchD
>for changes then interpret what they are according to your criteria. I
>wrote a simple scripted system that detected network location changes
>this way by comparing the current location to the existing one to
>detect a user initiated change of network location. It's not perfect
>but sufficed for what I was trying to do. I imagine with more
>time/effort using the SystemConfiguration frameworks would do the job
>with the agents to tell you what's going on.
>
>Philip

Thanks for the info. I have tried this before but I am not sure if I'm doing the right thing or not.

But is it a guarantee that the preferences.plist always gets updated whenever there are changes to the network interfaces.

Ian

Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Detect network interface changes
      • From: Ian Mark Salvame <email@hidden>
References: 
 >Detect network interface changes (From: Ian Mark Salvame <email@hidden>)
 >Re: Detect network interface changes (From: Ian Mark Salvame <email@hidden>)

  • Prev by Date: Re: Detect network interface changes
  • Next by Date: Re: Detect network interface changes
  • Previous by thread: Re: Detect network interface changes
  • Next by thread: Re: Detect network interface changes
  • Index(es):
    • Date
    • Thread