postinst 3.12 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/bash
#
# Copyright (C) 2004-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le5-greeter
#
# le5-greeter is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

if [ -x /usr/lib/lightdm/lightdm-set-defaults ] ; then
    /usr/lib/lightdm/lightdm-set-defaults --keep-old\
    --greeter=unity-greeter || true
fi

28
# Configure /etc/lightdm/lightdm.conf according to the current dist
29 30 31
if test -f /etc/le/data_iso.txt; then
    DIST=$(cut -d':' -f 1 /etc/le/data_iso.txt)
    if test -f /etc/lightdm/lightdm.conf; then
32 33 34 35 36 37 38 39 40 41 42 43 44

        # FIXME: This is not the best place to do this. It should be done by a minicom
        # specific package but we don't want le-greeter updates to overwrite minicom
        # settings.
        if test "$DIST" = "client"; then
            if ! grep -q "greeter-setup-script=/usr/local/bin/telecentro-start.sh" \
                /etc/lightdm/lightdm.conf; then
                echo "greeter-setup-script=/usr/local/bin/telecentro-start.sh" >> \
                    /etc/lightdm/lightdm.conf
            fi
        fi


45
        # Enable guest and manual login for le5/escola and le5/light
46
        if grep -q '^allow-guest' /etc/lightdm/lightdm.conf; then
47
            if test "$DIST" = "escola" -o "$DIST" = "light"; then
48
                sed -i -e '/^greeter-show-manual-login/s/false/true/' \
49 50
                    /etc/lightdm/lightdm.conf

51
                sed -i -e '/^allow-guest/s/false/true/' \
52
                    /etc/lightdm/lightdm.conf
53
            elif test "$DIST" = "home" -o "$DIST" = "multiterminal"; then
54
                sed -i -e '/^greeter-show-manual-login/s/true/false/' \
55 56
                    /etc/lightdm/lightdm.conf

57 58
                sed -i -e '/^allow-guest/s/true/false/' \
                    /etc/lightdm/lightdm.conf
59
            fi
60
        else
61
            if test "$DIST" = "escola" -o "$DIST" = "light"; then
62 63 64 65
                sed -i '/\[SeatDefaults\]/ a\allow-guest=true' \
                    /etc/lightdm/lightdm.conf
                sed -i '/\[SeatDefaults\]/ a\greeter-show-manual-login=true' \
                    /etc/lightdm/lightdm.conf
66
            elif test "$DIST" = "home" -o "$DIST" = "multiterminal"; then
67 68 69 70
                sed -i '/\[SeatDefaults\]/ a\greeter-show-manual-login=false' \
                    /etc/lightdm/lightdm.conf
                sed -i '/\[SeatDefaults\]/ a\allow-guest=false' \
                    /etc/lightdm/lightdm.conf
71
            fi
72
        fi
73 74 75
    fi
fi

76
exit 0