#!/bin/sh

# Create temp location
networksetup -createlocation TempLoc populate
sleep 5

# Switch to temp location
networksetup -switchtolocation TempLoc
sleep 5

# Delete Automatic location
networksetup -deletelocation Automatic
sleep 5

# Create Automatic location
networksetup -createlocation Automatic populate
sleep 5

# Switch to Automatic location
networksetup -switchtolocation Automatic
sleep 5

# Delete temp location
networksetup -deletelocation TempLoc
sleep 5

# Detect new hardware
networksetup -detectnewhardware
sleep 5

exit 0