→ n'exécuter que 2 & 6.
À l'aide du module datehook qui donne accès aux variables temporelles DAY, HOUR, MINUTE, MONTH, SECOND, WEEKDAY et YEAR, il est possible de forcer le démarrage par défaut sur un OS différent suivant notre humeur.
#!/bin/sh cat <<EOF # This module creates special variables that return the current date/time insmod datehook # Add and extra 0 to minutes if it's less than 10 (force a 2-digit minute) if [ \$MINUTE -lt 10 ]; then PADDING="0"; else PADDING=""; fi TIME=\$HOUR\$PADDING\$MINUTE # Boot "Windows XP" from 07AM to 11:50AM on Friday if [ \$WEEKDAY == Friday -a \$TIME -ge 0700 -a \$TIME -lt 1150 ]; then set default="Microsoft Windows XP Professionnel (on /dev/sda1)" else set default="Ubuntu" fi # If you want to boot an entry that's inside a submenu, # you have to prepend its name with the submenu position, starting from 0. # Boot "Ubuntu, with kernel 3.8.0-25-generic" from 5PM to 11:59PM #if [ \$TIME -ge 2056 -a \$TIME -lt 2359 ]; then # set default="1>Ubuntu, com Linux 3.8.0-25-generic" #fi EOF