I have a shell script i wrote for leopard that checks to see the ip address of the ethernet address on a macbook pro then turns off the airport if it has a specific IP address. I have updated it to work for lion, but now we have more then one IP segment I need to check against. What is the best way to go about it. Here is what i have now. IT works for only one IP segment.
#!/bin/sh
if ifconfig en0 | grep 20.1.20;
then
/usr/sbin/networksetup -setairportpower en1 off
else
/usr/sbin/networksetup -setairportpower en1 on
fi
so what i need to do is also check for the 21.1.21 network and another network that is 132.1.32 before it decides if it can turn of airport.
Model: Macbook Pro
Browser: Safari 534.48.3
Operating System: Mac OS X (10.7)