42 |
local grubopts |
local grubopts |
43 |
local OLD_IFS |
local OLD_IFS |
44 |
local grubconf="/boot/grub/grub.conf" |
local grubconf="/boot/grub/grub.conf" |
45 |
|
local pass |
46 |
|
|
47 |
KERNEL_IMAGE="$1" |
KERNEL_IMAGE="$1" |
48 |
KERNEL_DESCRIPTION="$2" |
KERNEL_DESCRIPTION="$2" |
94 |
: > ${grubconf} |
: > ${grubconf} |
95 |
echo "default 0" >> ${grubconf} |
echo "default 0" >> ${grubconf} |
96 |
echo "timeout 3" >> ${grubconf} |
echo "timeout 3" >> ${grubconf} |
97 |
# using roots current password |
# using roots current password if one was set |
98 |
echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} |
pass="$(grep '^root:' /etc/shadow | cut -d: -f2)" |
99 |
|
if [[ -n ${pass} ]] |
100 |
|
then |
101 |
|
echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} |
102 |
|
fi |
103 |
echo >> ${grubconf} |
echo >> ${grubconf} |
104 |
echo "# normal boot" >> ${grubconf} |
echo "# normal boot" >> ${grubconf} |
105 |
echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf} |
echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf} |