head     1.1;
branch   1.1.1;
access   ;
symbols  gfxboot-grub25:1.1.1.1 morphix:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2005.10.17.17.14.26;  author tcheun;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2005.10.17.17.14.26;  author tcheun;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@#!/bin/sh -e

NAME=grub-reboot
VERSION=0.01

if ! test -n "$1" || test "$1" = "-h" || test "$1" = "--help" ; then
  echo $NAME
  echo
  echo "Reboots into the specified OS entry in menu.lst"
  echo
  echo "Usage: $0 entry [options to grub]"
  echo "       (where \"entry\" is the entry number in menu.lst)"
  echo
  exit
fi

if test "$1" = "-v" || test "$1" = "--version" ; then
  echo $NAME $VERSION
  exit
fi

if test "`whoami`" != "root" ; then
  echo "You must be root"
  exit
fi

default="$1" ; shift
grub --batch $@@ <<EOT
savedefault --once --default=$default
quit
EOT

echo
echo -n "Do you want to reboot now? [y/N] "
read REBOOT
case $REBOOT in
  y*|Y*) reboot ;;
esac
@


1.1.1.1
log
@morhhix
@
text
@@
