#!/bin/bash # Root-Rechte prüfen if [ "$(id -u)" -ne 0 ]; then echo "Bitte mit sudo ausführen!" exit 1 fi apt update && apt upgrade -y apt install -y git sudo # Der Code, der eingefügt werden soll CONFIG_BLOCK='if groups | grep -q "\bsudo\b"; then case ":$PATH:" in *":/sbin:"*) ;; *) export PATH="$PATH:/sbin" ;; esac case ":$PATH:" in *":/usr/sbin:"*) ;; *) export PATH="$PATH:/usr/sbin" ;; esac fi' # Saubere Lösung über /etc/profile.d/ echo "$CONFIG_BLOCK" > /etc/profile.d/custom_path.sh chmod +x /etc/profile.d/custom_path.sh echo "Fertig! Bitte neu einloggen oder 'source /etc/profile.d/custom_path.sh' ausführen."