Hi,
Firstly thanks for reading my thread. I’ve just written a quit script to change the service order of my network adapters between my 3G Wireless Dongle and my Ethernet when I am at work.
It’s a but messy but it just copies out a plist depending on which order they currently are see below:
set _file to "/Library/Preferences/SystemConfiguration/preferences.plist"
set _contents to read _file
set _mepath to path to me as string
if _contents contains "<key>ServiceOrder</key>
<array>
<string>15A4E17E-0525-4792-933E-7B1E0FAC7AF4</string>
<string>353E5982-216F-4A7A-BB87-62EA104B995C</string>
<string>5C0E5611-B65C-43C4-9F06-C13F9D5DCBBB</string>
<string>1469F397-4294-4129-9A49-F3584F5E3B98</string>
<string>065CF19D-046C-4B6F-A40A-31AFB0DC0E14</string>
</array>" then
set _ethfile to _mepath & "Contents:Resources:eth:preferences.plist"
set _ethfile to POSIX path of _ethfile
do shell script "cp " & _ethfile & " /Library/Preferences/SystemConfiguration" user name "USERNAME" password "PASSWORDS" with administrator privileges
else if _contents contains "<key>ServiceOrder</key>
<array>
<string>353E5982-216F-4A7A-BB87-62EA104B995C</string>
<string>15A4E17E-0525-4792-933E-7B1E0FAC7AF4</string>
<string>5C0E5611-B65C-43C4-9F06-C13F9D5DCBBB</string>
<string>1469F397-4294-4129-9A49-F3584F5E3B98</string>
<string>065CF19D-046C-4B6F-A40A-31AFB0DC0E14</string>
</array>" then
set _dongfile to _mepath & "Contents:Resources:dong:preferences.plist"
set _dongfile to POSIX path of _dongfile
do shell script "cp " & _dongfile & " /Library/Preferences/SystemConfiguration" user name "USERNAME" password "PASSWORDS" with administrator privileges
end if
Currently it does actually switch the service but it doesn’t apply the setting which is obviously pretty useless.
Does anyone know of a way to apply the changes or make the correct process re-read the preferences file?
thanks in advance
Dave Maltby