]> git.donarmstrong.com Git - neurodebian.git/blobdiff - debian/neurodebian-guest-additions.postinst
Merge remote-tracking branch 'alioth/master' into newdesign
[neurodebian.git] / debian / neurodebian-guest-additions.postinst
old mode 100644 (file)
new mode 100755 (executable)
index 1db5889..760b0a8
@@ -1,14 +1,38 @@
 #!/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
+        # update gconf defaults tree
+               update-gconf-defaults
     fi
+}
+
+# XFCE4
+_set_lightdm_auto_login() {
+    lightdm_conf="$1"
+    if [ ! -e $lightdm_conf ]; then
+               echo "I: No config file $lightdm_conf found"
+    elif [ ! -z "$(grep '^# *autologin-user=' $lightdm_conf)" ]; then
+        echo "I: Enabling autologin of user 'brain' for lightdm."
+        sed -i -e 's/^# *autologin-user=.*$/autologin-user=brain/' $lightdm_conf
+    fi
+
+}
+
+gdm_conf=/etc/gdm/gdm.conf
+if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
+
+       [ -e /etc/gdm/gdm.conf ] && _set_gdm_auto_login /etc/gdm/gdm.conf 2 || :
+    [ -e /etc/gdm3/daemon.conf ] && _set_gdm_auto_login /etc/gdm3/daemon.conf 3 || :
 
-    # update gconf defaults tree
-    update-gconf-defaults
+       [ -e /etc/lightdm/lightdm.conf ] && _set_lightdm_auto_login /etc/lightdm/lightdm.conf || :
 fi
 
 #DEBHELPER#