-
-
Save johan149/0598c69f193f34058cf77fa3c3b68551 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
#!/bin/sh | |
# get internal IP, mac address, and public ip | |
# To install run the following | |
# sudo wget -qO /usr/local/bin/inet https://gist.githubusercontent.com/johan149/0598c69f193f34058cf77fa3c3b68551/raw/efcdcc0e0a8862e7de68f244af2cb0a20e33e06a/inet && sudo chmod a+x /usr/local/bin/inet | |
#to run just type and hit enter 'inet' | |
echo 'eno1' | |
eth1=eno1 | |
ip addr show $eth1 | awk '/inet/ {print $2}' | cut -d/ -f1 | |
echo '' | |
echo 'eno2' | |
eth2=eno2 | |
ip addr show $eth2 | awk '/inet/ {print $2}' | cut -d/ -f1 | |
echo '' | |
echo 'public ip' | |
(wget -qO- ifconfig.me | xargs echo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment