#! /bin/sh exec tail -n +3 ${0} # Look for hardware switch device by its hard-coded filesystem ID search --no-floppy --label --set hdswitch GRUB-SWITCH # If found, read dynamic config file and select appropriate entry for each position if [ "${hdswitch}" ] ; then source ($hdswitch)/switch.cfg if [ "${os_hw_switch}" == "l" ] ; then # Boot Linux set default="0" #change this to your Linux entry number set timeout=0 elif [ "${os_hw_switch}" == "w" ] ; then # Boot Windows set default="2" #change this to your windows entry number set timeout=0 elif [ "${os_hw_switch}" == "s" ] ; then # default with infinite timeout set default="${GRUB_DEFAULT}" set timeout=-1 else # Fallback to default set default="${GRUB_DEFAULT}" set timeout="${GRUB_TIMEOUT}" fi fi