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 | |
| # check it exists | |
| if test -f "$1"; then | |
| echo "Converting $1" | |
| else | |
| echo "Can't find \"$1\"" | |
| exit -1 | |
| fi | |
| # get the filename sans extension |
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 | |
| # Name: whatsmyip.sh | |
| # Description: A simple script to display the public IP address of the machine. | |
| # Usage: chmod +x whatsmyip.sh && ./whatsmyip.sh | |
| # Needs: dig (from dnsutils package) and https://github.com/MeanTimeCyber/ip-enrich | |
| # Function to display local network information | |
| display_local_ip() { | |
| local local_ipv4=$(hostname -I | awk '{print $1}') | |
| local local_ipv6=$(ip -6 addr show | grep 'inet6' | awk '{print $2}' | grep -v '^::1/' | head -n 1) |