I currently am trying to write a script that will check if a client is hardwired into an ethernet connection before running a script to rebind to AD. My idea so far has been to list the connected network IPs and go through that to make sure they're connected. Is there a way to search through the text for a set sequence/variable type of thing? I want to check for 10.101. in the beginning of one of the IPs to see if it has a wifi connection.
This is what I have written so far `
n=0
myArray=$(ifconfig -l | xargs -n1 ipconfig getifaddr)
for i in ${myArray[@]}
do
testString="$i"
echo $i
((n=n+1))
done
echo ${myArray[0]}
` This echoes all the IPs and counts how many there are.