[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: in difference time, can automatic change the default boot item?
From: |
Bean |
Subject: |
Re: in difference time, can automatic change the default boot item? |
Date: |
Tue, 29 Apr 2008 19:27:10 +0800 |
On Tue, Apr 29, 2008 at 5:58 PM, adrian15 <address@hidden> wrote:
>
>
> Bean escribió:
>
>
>
> > On Thu, Apr 24, 2008 at 5:39 PM, wolfman.wu <address@hidden> wrote:
> >
> > >
> > > my computer have linux & xp, I want to set:
> > >
> > > 1. daytime, the default boot item is XP
> > > 2. night, the default boot item auto change to LINUX
> > >
> > > the grub have this feature?
> > >
> >
> > No, grub doesn't have this feature, but some time ago, i write a patch
> > for grub4dos that implement a similar feature.It add a new command
> > checktime to test the current daytime:
> >
> > checktime * * * * *
> >
> > The five parameters for checktime is the same as in crontab:minute,
> > hour, day, month and day of week. this command check if the current
> > daytime is within the range specified by the parameters, and return
> > true or false accordingly. Combined this with the script support for
> > grub2, you can perform some operation in a selected time range.
> >
> > It's relative easy to port this to grub2, anyone interested ?
> >
>
> I am interested for adding it to Super Grub Disk, it might be a good
> feature to release a hard disk version of Super Grub Disk.
>
> Can you please send me the patch to see if it is easy for me to add the
> code to SGD or not?
>
> Thank you.
Hi,
This is the patch for grub4dos, it'd be trivial to integrate it with
GRUB Legacy. However, command checktime returns a boolean value, you
need some sort conditional statement to make it useful, in grub4dos,
you can use &&:
checktime * * * * * && default 0
But GRUB Legacy doesn't support this, so you need to think of some
other way to make it work, like embed the command in checktime itself.
--
Bean
grub4dos-checktime.diff
Description: Text document