networksetup -detectnewhardware

bentoms
Release Candidate Programs Tester

Hi guys,

My base image is normally created from a booted OS, with the Admin account & login window options baked in.
The below line creates new interfaces for those that are installed (i.e. Airport Cards on MacBooks), but they are often disabled.
/usr/sbin/networksetup -detectnewhardware
I would then enable all the disable interfaces/services using the below:
IFS=$' '
#Gets a list of all Network Services created
networkServices=networksetup -listallnetworkservices | tail +2
#Loops through the list of network services
for i in $(networksetup -listallnetworkservices | tail +2 );
do
#If network service if prefixed with a it's disabled
if [[ "$i" =~ '
' ]]; then
#Removes the * prefix
disabledServices=( echo $i | cut -c 2- )
#Enables the disabled network services
/usr/sbin/networksetup -setnetworkserviceenabled "$disabledServices" on
#Echo's the name of any services enabled
echo "$disabledServices now enabled..."
fi
done
echo "All Network Services have been enabled..."
unset IFS
exit 0
However, this has now stopped working :( looks like /usr/sbin/networksetup -detectnewhardware is not creating a service. The man page has not been updated to show this change.. but has anyone else seen this issue?

1 REPLY 1

bentoms
Release Candidate Programs Tester

ok.. well a reimage to 10.6.0 & it isn't working.. so i've no idea what i was doing before!!