Re: [Fed-Talk] Help with an apple/shell script
Re: [Fed-Talk] Help with an apple/shell script
- Subject: Re: [Fed-Talk] Help with an apple/shell script
- From: "Stephen Bowman" <email@hidden>
- Date: Fri, 10 Oct 2008 09:52:47 -0400
#networksetup -listallhardwareports | grep -B 1 en0 | awk '/Device/{print $2}'
en0
#
Say Hi for me to my ex-CCT (ISD?) coworkers there.
On Fri, Oct 10, 2008 at 9:30 AM, Nichols, Jared
<email@hidden> wrote:
Hi-
I'm trying to do either an applescript or a shell script to do this basic statement:
"For the interface en0, set the proxy url to http://llwww/proxy.pac"
Ideally, I'd like to shell script it as it's the closest I've gotten. My problem is that this will be for any Mac in our environment and they all don't have "Built-In Ethernet" as en0. I'd ideally like to use "en0" as the interface name as everything's primary ethernet is en0 as opposed to "Ethernet 1" on a MacPro, "Ethernet" on a Mac Mini, "Built-In Ethernet" on something older etc etc. Thus far, I've written a script like this:
#!/bin/sh
networksetup -setautoproxyurl "Ethernet" http://llwww/proxy.pac
networksetup -setautoproxyurl "Ethernet 1" http://llwww/proxy.pac
networksetup -setautoproxyurl "Ethernet 2" http://llwww/proxy.pac
networksetup -setautoproxyurl "Built-in Ethernet" http://llwww/proxy.pac
networksetup -setautoproxyurl "Built-in Ethernet 1" http://llwww/proxy.pac
networksetup -setautoproxyurl "Built-in Ethernet 2" http://llwww/proxy.pac
exit 0
Yes, it's ugly. I'd like to query networksetup somehow to return the interface name that is assigned to en0 and then use that in the script. I know some basic AppleScipt so if there's a way to do it with that, fine. (I know System Events comes in there somewhere, but not exactly sure where.) The goal is to place the resulting thing in the user template such that it's run the first time a new user logs in and only that time.
Any scripting genii out there?
Thanks!
j
--
Jared Nichols
ISD Infrastructure and Operations – Desktop Engineering
MIT Lincoln Laboratory
244 Wood St.
Lexington, MA 02420-9108
(781) 981-5500
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fed-talk mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fed-talk mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden