Last active
August 29, 2015 14:01
-
-
Save qwertypants/59eac089ab9a0d2d52db to your computer and use it in GitHub Desktop.
This file contains hidden or 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
void setup() { | |
system("telnetd -l /bin/sh"); | |
system("echo setup > /dev/ttyGS0"); | |
} | |
void loop() { | |
// Original code that prints out all data: | |
// system("ifconfig eth0 > /dev/ttyGS0"); | |
// Modified code to search for "inet addr" and print out the address | |
system("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' > /dev/ttyGS0"); | |
// Sleep is used here like the "delay" function to continuously print out the address for us. | |
sleep(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment