Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # !/bin/sh
- # Check if script is ran as root user
- if [ $(whoami) != "root" ]; then
- echo "You need to run this script as root user or do 'sudo $0'."
- exit 1
- fi
- # Prints MAC Address and status of each ethernet interface.
- for INTERFACE in $(ifconfig -a | grep eth | awk '{print $1}'); do
- echo "$INTERFACE $(ifconfig $INTERFACE | grep -i hwaddr* | awk '{print $5}') $(ethtool $INTERFACE | grep -i "link detected")"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement