--- mage/branches/alx-0_6_0/include/alx.minc 2011/06/30 15:16:33 2516 +++ mage/branches/alx-0_6_0/include/alx.minc 2011/06/30 15:22:45 2517 @@ -42,6 +42,7 @@ local grubopts local OLD_IFS local grubconf="/boot/grub/grub.conf" + local pass KERNEL_IMAGE="$1" KERNEL_DESCRIPTION="$2" @@ -93,8 +94,12 @@ : > ${grubconf} echo "default 0" >> ${grubconf} echo "timeout 3" >> ${grubconf} - # using roots current password - echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} + # using roots current password if one was set + pass="$(grep '^root:' /etc/shadow | cut -d: -f2)" + if [[ -n ${pass} ]] + then + echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} + fi echo >> ${grubconf} echo "# normal boot" >> ${grubconf} echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf}