A simple script to look up and save machine ip address.
This code is posted for informational purposes only. Use this code at your own risk.
If you find any bug in running the code, free feel to contact me at [email protected]. I will make effect to fix it, but I cannot guarantee the fix in time.
A simple script to look up and save machine ip address.
cgao$ python ip.py
A file 'myIP.txt' will be saved in current directory.
You can use crontab to make this script running in the backgroud at a preferred frequency (like 10 minutes).
You'd better change the saved filename with absolute path, otherwise it will be saved in the execution path, not the executed file's path.
For example, if you run the code like:
cgao$ pwd
/Users/cgao
cgao$ python ~/github/IP/ip.py
Copyright (c) 2013-2015 Chi Gao. See the LICENSE file for license rights and limitations (MIT).