Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'an example:' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
an example:
Authored by: CkB_Cowboy on Mar 21, '05 04:17:02PM
I thought I'd provide an example of usage. I named the script in the parent post isip, put it in the path, and made it executable, so it's accessible to any of my scripts.


#!/bin/bash

if [ `isip 192.168.0.70` ]; then
        open ~/bin/myscript_network_home
else
        open ~/bin/myscript_network_work
fi

Since I've configured my home DHCP server to reserve 192.168.0.70 for my laptop, and that address doesn't fall into the DHCP pool at work, this script can easily tell which network I'm on and run the right app, automagically!

- Cowboy

---
My ill-matic homepage:
http://rj3.net/cowboy/

[ Reply to This | # ]