#!/bin/bash ## Install me: ## wget -c -O /usr/bin/getMyPublicIP.sh https://ftp.info-linux.de/arbeiten/Linux/getMyPublicIP.sh.txt && chmod 755 /usr/bin/getMyPublicIP.sh CURL=$(which curl) if [ -z $CURL ]; then if [ $UID -eq 0 ]; then apt-update; apt install curl -y; CURL=$(which curl) else echo echo "Sie haben keine root rechte, bitte installieren sie CURL." echo exit 5; fi fi MyIPv4Address=$(curl -s https://ipv4.svc.joker.com/nic/myip) MyIPv6Address=$(curl -s https://ipv6.svc.joker.com/nic/myip) echo echo Meine Öffentliche IPv4 Adresse lautet: $MyIPv4Address echo Meine Öffentliche IPv6 Adresse lautet: $MyIPv6Address echo