Skip to content

Commit

Permalink
Fix reset_session script crash
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Nov 26, 2023
1 parent 10c3fca commit 2b9a4b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions __first_setup_reset_session
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

LOGIN_USERS=$(getent passwd | awk -F ':' "\$3 >= $(grep UID_MIN /etc/login.defs | cut -d " " -f 2) { print \$1 }" | uniq | sed '/^nobody$/d')
if [ "$(echo "${LOGIN_USERS}" | wc -l)" -gt 1 ]; then
Expand Down Expand Up @@ -28,6 +28,4 @@ while read entry; do
fi
done < <(getent passwd)

if [ -e "/var/lib/AccountsService/users/$REAL_USER" ]; then
echo '[User]\nSession=gnome' > /var/lib/AccountsService/users/$REAL_USER
fi
echo -e '[User]\nSession=gnome' > /var/lib/AccountsService/users/$REAL_USER

0 comments on commit 2b9a4b0

Please sign in to comment.