Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Get active network service name of default route' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Get active network service name of default route
Authored by: matamatangi on Feb 21, '05 01:08:57AM

the horror of those "|||"! printf works fine:

SERVICE_GUID=`printf "open\nget State:/Network/Global/IPv4\nd.show" | \
scutil | grep "PrimaryService" | awk '{print $3}'`


SERVICE_NAME=`printf "open\nget Setup:/Network/Service/$SERVICE_GUID\nd.show" |\
scutil | grep "UserDefinedName" | awk -F': ' '{print $2}'`

echo $SERVICE_NAME



[ Reply to This | # ]