summaryrefslogtreecommitdiffstats
path: root/ubuntu/raring/metapackages/casper-trinity/scripts/casper-bottom/15autologin-trinity
blob: a018471b74da6ce1680525001225c44450e321be (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

PREREQ=""
DESCRIPTION="Setting up automatic login (Trinity)..."

prereqs()
{
       echo "$PREREQ"
}

case $1 in
# get pre-requisites
prereqs)
       prereqs
       exit 0
       ;;
esac

. /scripts/casper-functions

log_begin_msg "$DESCRIPTION"

if [ -f /root/etc/trinity/kdm/kdmrc ]; then
    # Configure KDM-Trinity autologin
    sed -i -r \
        -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
        -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
        -e "s/^#?AutoLoginAgain=.*\$/AutoLoginAgain=true/" \
        /root/etc/trinity/kdm/kdmrc
fi

if [ -f /root/etc/trinity/tdm/tdmrc ]; then
    # Configure TDM-Trinity autologin
    sed -i -r \
        -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
        -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
        -e "s/^#?AutoLoginAgain=.*\$/AutoLoginAgain=true/" \
        /root/etc/trinity/tdm/tdmrc
fi

log_end_msg