#!/bin/bash

syncLocations='73A6408D-CE03-11D8-B5C8-000A95D370A4 26415746-FF16-11D8-B1C7-000A95D370A4'
#syncLocations is a space seperated list of network location id's, the script should sync in.
#You can get your id's by entering scselect into Terminal.app.

ExchangeScheduler='/System/Library/SyncServices/ExchangeConduit.bundle/Contents/Resources/ExchangeScheduler.bin'
activeLocation=`scselect 2>&1 | egrep '^\ *\*'| cut -c 4- | cut -c -36`
for i in $syncLocations
do
	if [ "$activeLocation" == "$i" ]
	then
		if curl -k `defaults read com.apple.IISSupport IISServerPath` >/dev/null 2>&1
		then
			$ExchangeScheduler $*
		fi
	fi
done

