lock_unlock_bashrc.sh hinzugefügt

Neu erstellt im Git
This commit is contained in:
alf
2025-08-07 10:26:02 +00:00
parent 5145b33887
commit 556f29bd56

55
lock_unlock_bashrc.sh Normal file
View File

@ -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