Correcting kdm live-autologin handling to not always append entries forever when...
authorDaniel Baumann <daniel@debian.org>
Thu, 26 Mar 2009 13:11:56 +0000 (14:11 +0100)
committerDaniel Baumann <daniel@debian.org>
Thu, 26 Mar 2009 14:17:25 +0000 (15:17 +0100)
scripts/live-bottom/14locales
scripts/live-bottom/15autologin

index 6348338..58f7e82 100755 (executable)
@@ -104,7 +104,10 @@ then
 
        if [ -d /root/etc/default/kdm.d/ ]
        then
-               printf 'LANGUAGE=%s\n' "${LANG}" >> /root/etc/default/kdm.d/live-autologin
+               if ! grep -qs "^LANGUAGE" "${LANG}"
+               then
+                       printf 'LANGUAGE=%s\n' "${LANG}" >> /root/etc/default/kdm.d/live-autologin
+               fi
        elif [ -f /root/etc/kde3/kdm/kdmrc ]
        then
                sed -i -r -e "s/#Language=.*/Language=${language}/" \
index 7fb2b13..38c3a8f 100755 (executable)
@@ -59,6 +59,8 @@ fi
 
 if [ -d /root/etc/default/kdm.d/ ]
 then
+       if ! grep -qs "^AUTOLOGIN" /root/etc/default/kdm.d/live-autologin
+       then
 
 cat >> /root/etc/default/kdm.d/live-autologin << EOF
 AUTOLOGINUSER=${USERNAME}
@@ -66,6 +68,8 @@ AUTOLOGINAGAIN=true
 AUTOLOGINDELAY=0
 EOF
 
+       fi
+
 elif [ -f /root/etc/kde3/kdm/kdmrc ]
 then
        # Configure KDM autologin