summaryrefslogtreecommitdiff
path: root/scripts/live-bottom
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2010-05-01 12:52:27 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:48:09 +0100
commit1bad81c0450e84a94dc1d5f4ead9886f15749b80 (patch)
treee95a7ef1d08acb6b14ab66170f0e3a139b86e8b1 /scripts/live-bottom
parenta3e443f92f8cab935004c280c24b147a2fd0a9df (diff)
downloadlive-boot-1bad81c0450e84a94dc1d5f4ead9886f15749b80.tar.gz
live-boot-1bad81c0450e84a94dc1d5f4ead9886f15749b80.zip
Merging casper 1.211.
Diffstat (limited to 'scripts/live-bottom')
-rwxr-xr-xscripts/live-bottom/15autologin30
1 files changed, 19 insertions, 11 deletions
diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin
index 5bd9609..2758c95 100755
--- a/scripts/live-bottom/15autologin
+++ b/scripts/live-bottom/15autologin
@@ -55,18 +55,26 @@ then
-e "s/^TimedLogin=.*\$/TimedLogin=${USERNAME}/" \
-e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
${GDMCONF}
-elif [ -d /root/etc/gdm3 ] && [ ! -e /root/etc/gdm3/custom.conf ]
+elif [ -d /root/etc/gdm3 ]
then
-
-cat > /root/etc/gdm3/custom.conf << EOF
-[daemon]
-AutomaticLoginEnable=true
-AutomaticLogin=$USERNAME
-TimedLoginEnable=true
-TimedLogin=$USERNAME
-TimedLoginDelay=10
-EOF
-
+ GDMCustomFile=/root/etc/gdm3/custom.conf
+ AutologinParameters="AutomaticLoginEnable=true\n\
+AutomaticLogin=$USERNAME\n\
+TimedLoginEnable=true\n\
+TimedLogin=$USERNAME\n\
+TimedLoginDelay=10"
+
+ # Prevent from updating if parameters already present (persistent usb
+ # key)
+ if ! $(grep -qs 'AutomaticLoginEnable' $GDMCustomFile)
+ then
+ if $(grep -qs '\[daemon\]' $GDMCustomFile)
+ then
+ sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
+ else
+ echo -e "[daemon]\n$AutologinParameters" >> $GDMCustomFile
+ fi
+ fi
fi
if [ -d /root/etc/default/kdm.d/ ]