From 87659479470e461abd9b6c7702212c72fdb3a5f5 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 20 Jul 2012 12:43:34 -0400 Subject: [PATCH] BF: gues-additions -- autologin for both Gnome 2 and 3 --- debian/neurodebian-guest-additions.postinst | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) mode change 100644 => 100755 debian/neurodebian-guest-additions.postinst diff --git a/debian/neurodebian-guest-additions.postinst b/debian/neurodebian-guest-additions.postinst old mode 100644 new mode 100755 index 1db5889..6a5336e --- a/debian/neurodebian-guest-additions.postinst +++ b/debian/neurodebian-guest-additions.postinst @@ -1,11 +1,22 @@ #!/bin/bash -e -gdm_conf=/etc/gdm/gdm.conf -if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then - if [ -z "$(grep 'AutomaticLogin=brain' $gdm_conf)" ]; then - echo "Enabling autologin of user 'brain'." +# GNOME2 +_set_gdm_auto_login() { + gdm_conf="$1" + gnome_ver="$2" + if [ ! -e $gdm_conf ]; then + echo "I: No config file $gdm_conf GNOME $gnome_ver found" + elif [ -z "$(grep 'AutomaticLogin=brain' $gdm_conf)" ]; then + echo "I: Enabling autologin of user 'brain' for GNOME $gnome_ver." sed -i -e 's/^\[daemon\]$/\[daemon\]\nAutomaticLoginEnable=true\nAutomaticLogin=brain\n/' $gdm_conf fi +} + +gdm_conf=/etc/gdm/gdm.conf +if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then + + _set_gdm_auto_login /etc/gdm/gdm.conf 2 + _set_gdm_auto_login /etc/gdm3/daemon.conf 3 # update gconf defaults tree update-gconf-defaults -- 2.39.2