Changeset 139


Ignore:
Timestamp:
Nov 25, 2005, 11:40:52 PM (14 years ago)
Author:
bcornec
Message:

Here is a fix needed to restore mondo backups on md-raid systems;
grub seems to always exit with 0, even when some commands failed.
(Philippe De Muyter <phdm_at_macqel.be>)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.05/mondo/mondo/restore-scripts/mondo/grub-MR

    r30 r139  
    55#
    66#
     7#
     8# 2005/11/25
     9# - try_grub_hack : do not return success when grub wrote 'Error '
    710#
    811# 2004/06/28
     
    118121    quit \n" > /tmp/feed.txt
    119122    cat /tmp/feed.txt
     123    log_file=/tmp/grub.output
    120124    if [ "$MNT_RESTORING" ] ; then
    121         chroot /mnt/RESTORING grub --batch < /tmp/feed.txt
     125        chroot /mnt/RESTORING grub --batch < /tmp/feed.txt > $log_file
    122126    else
    123         grub --batch < /tmp/feed.txt
     127        grub --batch < /tmp/feed.txt > $log_file
    124128    fi
    125     return $?
     129    cat $log_file
     130    if grep "Error [0-9]*: " $log_file >/dev/null; then
     131            return 1
     132    else
     133            return 0
     134    fi
    126135}
    127136
Note: See TracChangeset for help on using the changeset viewer.