From e03c823db34c31edfd0add54cd71dc98d6d75cec Mon Sep 17 00:00:00 2001 From: alf Date: Fri, 15 Aug 2025 16:25:03 +0000 Subject: [PATCH] lock_unlock_bashrc.sh aktualisiert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Logging hinzugefügt. --- lock_unlock_bashrc.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lock_unlock_bashrc.sh b/lock_unlock_bashrc.sh index fd22f25..d21f28f 100644 --- a/lock_unlock_bashrc.sh +++ b/lock_unlock_bashrc.sh @@ -1,3 +1,8 @@ +source /root/logger.sh + +log_start +log_info "Starte Lock/Unlock Bashrc" + ende=nein while [ $ende = "nein" ]; do @@ -17,18 +22,18 @@ read -p "Deine Wahl: 1/2/3/0 " wwahl if [ $wwahl = 1 ] then sudo chattr +i .bashrc - echo "Gesichert! "$? + log_info "Gesichert! $?" fi if [ $wwahl = 2 ] then sudo chattr -i .bashrc - echo "Geöffnet! "$? - echo "öffne Datei..." + log_info "Geöffnet! $?" + log_info "öffne Datei..." nano .bashrc - echo "Datei geschlossen "$? + log_info "Datei geschlossen $?" sudo chattr +i .bashrc - echo "Gesichert "$? + log_info "Gesichert $?" source /home/oberkoetter/.bashrc echo "Änderungen sind nach dem Neustart der" echo "Konsole wirksam" @@ -37,14 +42,15 @@ fi if [ $wwahl = 22 ] then sudo chattr -i .bashrc - echo "Geöffnet! "$? + log_info "Geöffnet! $?" exit 0 fi if [ $wwahl = "3" ] then + log_info "Lese neu…" . .bashrc - echo $? + log_info "Err: $?" fi if [ $wwahl = "0" ] @@ -53,3 +59,5 @@ then fi done + +log_end