All pastes #1753813 Raw Edit

3PO

public text v1 · immutable
#1753813 ·published 2010-01-16 19:19 UTC
rendered paste body
#!/bin/bashBOOT_DEV="$(grep " / " /etc/fstab)"BOOT_DEV="${BOOT_DEV%%[0-9] *}"GRUB=$'(file -s $BOOT_DEV |grep "GRand Unified Bootloader")'LILO=$'(file -s $BOOT_DEV |grep "LInux i386 boot LOader")'if [ $"LILO" ] ; then  lilo -R poweroff  reboot  exit else   if [ $"GRUB" ] ; then     REBOOT_LINE=$(grep -s ^title /boot/grub/grub.conf |grep -i -n poweroff | { IFS=: read a b ; echo $a ; })     grub-set-default $((REBOOT_LINE-1))     reboot     exit   fifi