X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F15autologin;h=2758c95ac39e5b33a4e4bcfd18ce0c2062b2ddb2;hb=1bad81c0450e84a94dc1d5f4ead9886f15749b80;hp=3f85d501547bcb974d2f14f16ad6d5e976ecd6df;hpb=88dea2ac418e83dab5be51632d7c2687c0f809d7;p=live-boot-grml.git diff --git a/scripts/live-bottom/15autologin b/scripts/live-bottom/15autologin index 3f85d50..2758c95 100755 --- a/scripts/live-bottom/15autologin +++ b/scripts/live-bottom/15autologin @@ -57,16 +57,24 @@ then ${GDMCONF} 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/ ]