]> git.donarmstrong.com Git - neurodebian.git/blob - debian/neurodebian-guest-additions.postinst
Also for stats report which repo and which job number use our setup
[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         # update gconf defaults tree
13                 update-gconf-defaults
14     fi
15 }
16
17 # XFCE4
18 _set_lightdm_auto_login() {
19     lightdm_conf="$1"
20     if [ ! -e $lightdm_conf ]; then
21                 echo "I: No config file $lightdm_conf found"
22     elif [ ! -z "$(grep '^# *autologin-user=' $lightdm_conf)" ]; then
23         echo "I: Enabling autologin of user 'brain' for lightdm."
24         sed -i -e 's/^# *autologin-user=.*$/autologin-user=brain/' $lightdm_conf
25     fi
26
27 }
28
29 gdm_conf=/etc/gdm/gdm.conf
30 if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
31
32         [ -e /etc/gdm/gdm.conf ] && _set_gdm_auto_login /etc/gdm/gdm.conf 2 || :
33     [ -e /etc/gdm3/daemon.conf ] && _set_gdm_auto_login /etc/gdm3/daemon.conf 3 || :
34
35         [ -e /etc/lightdm/lightdm.conf ] && _set_lightdm_auto_login /etc/lightdm/lightdm.conf || :
36 fi
37
38 #DEBHELPER#
39