-
Notifications
You must be signed in to change notification settings - Fork 47
/
Current AirPort Network.xml
39 lines (34 loc) · 1.49 KB
/
Current AirPort Network.xml
1
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute> <displayName>Current AirPort Network</displayName> <displayInCategory>Networking</displayInCategory> <description>This attribute displays the network the AirPort is joined to. This attribute applies to Mac only.</description> <dataType>string</dataType> <scriptContentsMac>#!/bin/sh# Determine the OS version since the networksetup command differs on OSOS=`/usr/bin/sw_vers -productVersion | /usr/bin/colrm 5`if [[ "$OS" < "10.5" ]]; then# Ensure that the networksetup link exists on 10.4 and earlierif [ -f /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup ];then result=`/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -getairportnetwork | sed 's/Current AirPort Network: //g'`else result=`The networksetup binary is not present on this machine.`fielif [ "$OS" == "10.5" ]; thenresult=`/usr/sbin/networksetup -getairportnetwork | sed 's/Current AirPort Network: //g'`elseresult=`/usr/sbin/networksetup -getairportnetwork AirPort | sed 's/Current AirPort Network: //g'`fi# Ensure that AirPort was foundhasAirPort=`echo "$result" | grep "Error"`# Report the resultif [ "$hasAirPort" == "" ]; thenecho "<result>$result</result>"elseecho "<result>No AirPort Device Found.</result>"fi </scriptContentsMac> <scriptTypeWindows>VBScript</scriptTypeWindows> <scriptContentsWindows> </scriptContentsWindows></extensionAttribute>