Merging casper 1.214.
[live-boot-grml.git] / scripts / live-bottom / 15autologin
index 0b80f84..a4df2df 100755 (executable)
@@ -66,15 +66,12 @@ TimedLoginDelay=10"
 
        # Prevent from updating if parameters already present (persistent usb
        # key)
-       if ! $(grep -qs 'AutomaticLoginEnable' $GDMCustomFile)
+       if ! $(grep -qs '\[daemon\]' $GDMCustomFile)
        then
-               if $(grep -qs '\[daemon\]' $GDMCustomFile)
-               then
-                       sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
-               else
-                       printf "[daemon]\n$AutologinParameters" >> $GDMCustomFile
-               fi
+               echo '[daemon]' >> $GDMCustomFile
        fi
+
+       sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
 fi
 
 if [ -d /root/etc/default/kdm.d/ ]