Update Ansible/ssh-keyscan.sh

This commit is contained in:
2025-05-07 07:59:21 +00:00
parent 78afc2fcec
commit f4c684b51d

View File

@@ -7,7 +7,7 @@ set -euo pipefail
# ---------- Root-Check (sofort & sicher) -------------- # ---------- Root-Check (sofort & sicher) --------------
script_path=$(readlink -f "$0") # absoluter Pfad des Skripts 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 sudo -v # 1× Passwort, Timestamp bleibt gültig
exec sudo -- "$script_path" "$@" # ersetzt Prozess, KEIN zweiter Prompt exec sudo -- "$script_path" "$@" # ersetzt Prozess, KEIN zweiter Prompt
fi fi