X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F10adduser;h=4c0fe8013958984ce0be03bc28a41a46ea9cf1d6;hb=b3416142f2a676acbfca0738ea386d40bef74313;hp=907aed026e32c16dcf51d5d8c8792f629507e4fe;hpb=a5c38c897b8ccbb22171a6799b8757645dd59fff;p=live-boot-grml.git diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser index 907aed0..4c0fe80 100755 --- a/scripts/live-bottom/10adduser +++ b/scripts/live-bottom/10adduser @@ -40,7 +40,7 @@ set passwd/root-password-crypted * set passwd/user-password-crypted ${user_crypted} set passwd/user-fullname ${USERFULLNAME} set passwd/username ${USERNAME} -set passwd/user-uid 999 +set passwd/user-uid 1000 EOF chroot /root /usr/bin/env -i HOME="/root" \ @@ -58,6 +58,28 @@ set passwd/username set passwd/user-uid EOF +if ! grep "${USERNAME}" /root/etc/passwd +then + echo "The default user (${USERNAME}) is not present," + first_user=$(grep '^[^:]*:[^:]*:[12]\?[0-9][0-9][0-9][0-9]:' /root/etc/passwd | head -1 | cut -f1 -d ':') + if [ -n "${first_user}" ]; + then + echo "setting default user to: ${first_user}." + USERNAME="${first_user}" + really_export USERNAME + else + echo "no other valid users found, disabling autologin." + NOAUTOLOGIN="Yes" + NOXAUTOLOGIN="Yes" + USERNAME="" + really_export NOAUTOLOGIN + really_export NOXAUTOLOGIN + really_export USERNAME + log_end_msg + exit 0 + fi +fi + if [ -z "${NOSUDO}" ] then if ! grep -q "${USERNAME}" /root/etc/sudoers