Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions activate_localuser.linbofunc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ activate_localuser() {
# Aufruf: activate_localuser on|off
#######################################################
ACCOUNTNAME=schueler
[ $(grep -e "$ACCOUNTNAME:\!" /mnt/etc/shadow) ] && STATUS=DEAKTIVIERT || STATUS=AKTIV
[ $(grep -e "!$ACCOUNTNAME:" /mnt/etc/shadow) ] && STATUS=DEAKTIVIERT || STATUS=AKTIV

case "$1" in
on)
Expand All @@ -14,7 +14,7 @@ activate_localuser() {
;;
DEAKTIVIERT)
echo "aktiviere User \"$ACCOUNTNAME\""
sed -e "s/$ACCOUNTNAME:\!/$ACCOUNTNAME:/g" -i /mnt/etc/shadow
sed -e "s/!$ACCOUNTNAME:/$ACCOUNTNAME:/1" -i /mnt/etc/shadow
;;
*)
echo 'diese Programmzeile hätte nie aufgerufen werden dürfen...'
Expand All @@ -26,7 +26,7 @@ activate_localuser() {
AKTIV)
echo "Status: $STATUS"
echo "deaktiviere User"
sed -e "s/$ACCOUNTNAME:/$ACCOUNTNAME:\!/g" -i /mnt/etc/shadow
sed -e "s/$ACCOUNTNAME:/!$ACCOUNTNAME:/1" -i /mnt/etc/shadow
;;
DEAKTIVIERT)
echo "User ist bereits inaktiv. Keine Aktion nötig."
Expand Down