#!/bin/sh trap bye 2 bye() { printf "OK Bye.\n"; exit 0; } menu() { clear cat <<-EOF 1 IP daheim über AVM ermittelt 2 IP daheim über selfhost ermittelt 3 IP mein Hetzner Server 4 IP local über curl ifconfig.me q Quit IP=${IP:-Keine IP} ${auswahl:+\(Methode $auswahl\)} EOF } while true; do menu printf "\nAuswahl: " read -r auswahl case "$auswahl" in 1) IP="$(dig +short ?????????myfritz.net)"; ;; 2) IP="$(dig +short ?????????mydyndnsservice)"; ;; 3) IP="$(dig +short andi.uugrn.org)"; ;; 4) IP="$(curl -s ifconfig.me)"; ;; [qQ5]) bye; ;; esac done