From 556f29bd560cc58a720bf79238e0cea1f984b1d5 Mon Sep 17 00:00:00 2001 From: alf Date: Thu, 7 Aug 2025 10:26:02 +0000 Subject: [PATCH] =?UTF-8?q?lock=5Funlock=5Fbashrc.sh=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neu erstellt im Git --- lock_unlock_bashrc.sh | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 lock_unlock_bashrc.sh diff --git a/lock_unlock_bashrc.sh b/lock_unlock_bashrc.sh new file mode 100644 index 0000000..fd22f25 --- /dev/null +++ b/lock_unlock_bashrc.sh @@ -0,0 +1,55 @@ +ende=nein + +while [ $ende = "nein" ]; do +echo +echo +echo "1 = LOCK" +echo " " +echo "2 = UNLOCK und Editieren" +echo "22= UNLOCK und Ende" +echo " " +echo "3 = .bashrc neu einlesen" +echo " " +echo "0 = Ende" +echo +read -p "Deine Wahl: 1/2/3/0 " wwahl + +if [ $wwahl = 1 ] +then + sudo chattr +i .bashrc + echo "Gesichert! "$? +fi + +if [ $wwahl = 2 ] +then + sudo chattr -i .bashrc + echo "Geöffnet! "$? + echo "öffne Datei..." + nano .bashrc + echo "Datei geschlossen "$? + sudo chattr +i .bashrc + echo "Gesichert "$? + source /home/oberkoetter/.bashrc + echo "Änderungen sind nach dem Neustart der" + echo "Konsole wirksam" +fi + +if [ $wwahl = 22 ] +then + sudo chattr -i .bashrc + echo "Geöffnet! "$? + exit 0 +fi + +if [ $wwahl = "3" ] +then + . .bashrc + echo $? +fi + +if [ $wwahl = "0" ] +then + ende="ja" +fi + +done