]> git.donarmstrong.com Git - neurodebian.git/blob - debian/neurodebian-guest-additions.postinst
BF: gues-additions -- autologin for both Gnome 2 and 3
[neurodebian.git] / debian / neurodebian-guest-additions.postinst
1 #!/bin/bash -e
2
3 # GNOME2
4 _set_gdm_auto_login() {
5     gdm_conf="$1"
6         gnome_ver="$2"
7     if [ ! -e $gdm_conf ]; then
8                 echo "I: No config file $gdm_conf GNOME $gnome_ver found"
9     elif [ -z "$(grep 'AutomaticLogin=brain' $gdm_conf)" ]; then
10         echo "I: Enabling autologin of user 'brain' for GNOME $gnome_ver."
11         sed -i -e 's/^\[daemon\]$/\[daemon\]\nAutomaticLoginEnable=true\nAutomaticLogin=brain\n/' $gdm_conf
12     fi
13 }
14
15 gdm_conf=/etc/gdm/gdm.conf
16 if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
17
18     _set_gdm_auto_login /etc/gdm/gdm.conf 2
19     _set_gdm_auto_login /etc/gdm3/daemon.conf 3
20
21     # update gconf defaults tree
22     update-gconf-defaults
23 fi
24
25 #DEBHELPER#
26