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