From e2e68edafab23ca51161c890393986fd96bb362e Mon Sep 17 00:00:00 2001 From: admManuel Date: Wed, 12 Feb 2025 09:30:05 +0000 Subject: [PATCH] Update Linux/SSH/README.md --- Linux/SSH/README.md | 54 +-------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/Linux/SSH/README.md b/Linux/SSH/README.md index 36d3a78..b2d181b 100644 --- a/Linux/SSH/README.md +++ b/Linux/SSH/README.md @@ -252,56 +252,4 @@ else fi log "Setup abgeschlossen! Nur folgende Benutzer dürfen sich per SSH anmelden: ${WHITE}$VALID_USERS" -``` - -# BASH Farbprofil - -```bash -#!/bin/bash - -BASHRC_CONTENT="\n# Farbiges ls und grep\nalias ls='ls --color=auto'\nalias grep='grep --color=auto'\nalias egrep='egrep --color=auto'\nalias fgrep='fgrep --color=auto'\neval \"\$(dircolors -b ~/.dircolors)\"\nif [ \"\$EUID\" -eq 0 ]; then\n PS1='\\[\\e[1;31m\\]\\u\\[\\e[0;33m\\]@\\[\\e[1;35m\\]\\h \\\[\\e[1;33m\\]\\w\\[\\e[0m\\] # ' -else\n PS1='\\[\\e[1;32m\\]\\u\\[\\e[0;33m\\]@\\[\\e[1;35m\\]\\h \\\[\\e[1;34m\\]\\w\\[\\e[0m\\] \\\$ ' -fi\n" - -# Sicherstellen, dass die Datei ~/.dircolors erstellt wird -dircolors -p > ~/.dircolors - -# Funktion, um die .bashrc Datei zu aktualisieren -update_bashrc() { - local user_home=$1 - local bashrc_file="$user_home/.bashrc" - - # Sicherstellen, dass die Datei existiert - touch "$bashrc_file" - - # Prüfen, ob der Inhalt bereits existiert, wenn nicht, hinzufügen - if ! grep -q "Farbiges ls und grep" "$bashrc_file"; then - echo -e "$BASHRC_CONTENT" >> "$bashrc_file" - echo "$bashrc_file wurde aktualisiert." - else - echo "$bashrc_file ist bereits aktuell." - fi - - # .dircolors in das Benutzerverzeichnis kopieren (außer für root) - if [ "$user_home" != "/root" ]; then - cp ~/.dircolors "$user_home/.dircolors" - chown $(basename $user_home):$(basename $user_home) "$user_home/.dircolors" - fi -} - -# Aktualisiere die .bashrc Datei für root -update_bashrc /root - -# Aktualisiere die .bashrc Datei für alle Benutzer im /home Verzeichnis -for dir in /home/*; do - if [ -d "$dir" ]; then - update_bashrc "$dir" - fi -done - -echo "Skriptausführung abgeschlossen." -``` - ---- - -Falls du weitere Fragen hast oder Anpassungen benötigst, lass es mich wissen! 😊 +``` \ No newline at end of file