initial commit

This commit is contained in:
Donald Burr 2015-02-14 21:21:40 -08:00
commit c3b94b7106
91 changed files with 56958 additions and 0 deletions

16
network_info Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
#
# Script that prints out active network interfaces' IP and MAC addresses
#
# Donald Burr <dburr@vctlabs.com>
if ip a | grep -Eq ': eth0:.*state UP'; then
eth_ip=$(ip addr | awk '/inet/ && /eth0/{sub(/\/.*$/,"",$2); print $2}')
eth_mac=`ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
echo "ethernet: IP=$eth_ip MAC=$eth_mac"
fi
if ip a | grep -Eq ': wlan0:.*state UP'; then
wifi_ip=$(ip addr | awk '/inet/ && /wlan0/{sub(/\/.*$/,"",$2); print $2}')
wifi_mac=`ifconfig wlan0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'`
echo " wifi: IP=$wifi_ip MAC=$wifi_mac"
fi