diff --git a/Ansible/ssh-keyscan.sh b/Ansible/ssh-keyscan.sh index 6155964..bd0c79d 100644 --- a/Ansible/ssh-keyscan.sh +++ b/Ansible/ssh-keyscan.sh @@ -7,7 +7,7 @@ set -euo pipefail # ---------- Root-Check (sofort & sicher) -------------- script_path=$(readlink -f "$0") # absoluter Pfad des Skripts -if [[ $EUID -ne 0 ]]; then +if [ "$(id -u)" -ne 0 ]; then sudo -v # 1× Passwort, Timestamp bleibt gültig exec sudo -- "$script_path" "$@" # ersetzt Prozess, KEIN zweiter Prompt fi