MacOS - bash script to change IP settings

in macos •  7 years ago  (edited)

I work in organisation with paranoiac system administrators...
Every morning on my work i have to change IP settings on my Macbook manually.
Plus every week they send new IP address, gateway, mask.

Screen Shot 2018-01-02 at 23.47.46.png

And this is annoying.
So i made simple script that starts every time i came on work and back home/cafe/etc.
If someone have same problem or something like that, here it is:

[code]
echo “home or work?”
read ipconf
if [ $ipconf = work ]
then
networksetup -setmanual Wi-Fi 111.111.1.111 255.255.0.0 111.111.1.112
echo “Work settings applied.”
fi
if [ $ipconf = home ]
then
networksetup -setdhcp Wi-Fi
echo “Home settings applied.”
fi
[/code]

You can call it from terminal:
bash ip.sh
(in my case ip.sh - file name)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @medevin! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!