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/bash | |
| #Setting variables | |
| PARTITION=`mount | grep 'on / type' | cut -d" " -f1` | |
| DISK=${PARTITION::-1} | |
| echo "Disk: $DISK" | |
| ADDRESS=`ip -4 addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` | |
| echo "IPv4 address: $ADDRESS\n" | |
| GATEWAY=`ip -4 route list | grep default | cut -d' ' -f 3` | |
| echo "IPv4 gateway: $GATEWAY\n" | |
| ADDRESS6=`ip -6 addr show eth0 | grep global | grep inet6 | cut -d' ' -f 6 | head -n 1` |