Created
November 29, 2011 15:49
-
-
Save rubiojr/1405266 to your computer and use it in GitHub Desktop.
ip-info daemon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Stupid bash daemon to output IP addresses to /etc/ip-info file | |
# | |
INFO_FILE=/tmp/ip-info | |
FREQ=15 | |
echo "Starting IP-INFO Daemon"; | |
ip addr list | grep "inet " | cut -d' ' -f6 | cut -d/ -f1 > $INFO_FILE | |
while :; do | |
sleep $FREQ; | |
ip addr list | grep "inet " | cut -d' ' -f6 | cut -d/ -f1 > $INFO_FILE | |
done & disown -h $! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment