diff options
-rwxr-xr-x | useraddhook/customize.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/useraddhook/customize.sh b/useraddhook/customize.sh index 14230a2..d405b72 100755 --- a/useraddhook/customize.sh +++ b/useraddhook/customize.sh @@ -10,6 +10,7 @@ # - requires the passwd and coreutils packages installed inside the chroot # - adds the new user to the sudo group if it exists # - ~/.ssh/authorized_keys files is copied from root user if it exists +# - enables immediate autologin via lightdm if installed # # Example usage: # @@ -34,3 +35,10 @@ if [ -e "$1"/root/.ssh/authorized_keys ]; then chroot "$1" install -o "$USERNAME" -g "$USERNAME" -m 700 -d "/home/$USERNAME/.ssh" chroot "$1" install -o "$USERNAME" -g "$USERNAME" -t "/home/$USERNAME/.ssh" /root/.ssh/authorized_keys fi +if [ -e "$1/etc/lightdm/lightdm.conf" ]; then + cat >>"$1/etc/lightdm/lightdm.conf" <<EOF +[SeatDefaults] +autologin-user=$USERNAME +autologin-user-timeout=0 +EOF +fi |