X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F10adduser;h=92950707e772c38d40988cb679865cee1f676d47;hb=be6b1ff8961f46a2bf51811bdd536c3d90239027;hp=7498476b951929e77ffed5dcd7dfd215daac10b9;hpb=c2102d9620c54541825f267d1b9575d886e8b820;p=live-boot-grml.git diff --git a/scripts/live-bottom/10adduser b/scripts/live-bottom/10adduser index 7498476..9295070 100755 --- a/scripts/live-bottom/10adduser +++ b/scripts/live-bottom/10adduser @@ -58,6 +58,28 @@ set passwd/username set passwd/user-uid EOF +if ! grep -qs "${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