[ubuntu-in] scripting in grub.cfg

Nitesh Mistry mailbox at mistrynitesh.net
Mon Nov 29 09:57:21 GMT 2010


On Mon, Nov 29, 2010 at 01:53:45PM +0530, Alok Singh Mahor wrote:
> Hi all,
> my grub menu has 5 entries. grub.cfg has line set default="0"
> i want to change its value alternately on every restart from 0 to 4 and 4 to
> 0
> so I can get different default on grub menu everytime at startup. I think I
> have to add few if/else to do this. but I am unable to do. please tell me
> how can I achieve this?

Though I don't know exact answer to your question, I would like to remind
you that whatever changes you want to make, make them in /etc/grub.d/00_header
file (after backing up the original file ofcourse). Otherwise all your changes
will get wiped out the next time either you or the kernel upgrade routine does
grub-update.

grub-update automatically updates /boot/grub/grub.cfg using the values /
instructions in /etc/grub.d/* files


-- 
Regards,
Nitesh Mistry | www.mistrynitesh.com
PGP key id: A6FEF696 | 'geekosopher' on freenode irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/ubuntu-in/attachments/20101129/53a584b2/attachment.pgp 


More information about the ubuntu-in mailing list