Skip to content

Instantly share code, notes, and snippets.

@rubiojr
Created November 29, 2011 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubiojr/1405266 to your computer and use it in GitHub Desktop.
Save rubiojr/1405266 to your computer and use it in GitHub Desktop.
ip-info daemon
#!/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