source: MondoRescue/branches/2.2.10/mindi/rootfs/sbin/post-init@ 2378

Last change on this file since 2378 was 2378, checked in by Bruno Cornec, 15 years ago
  • Suppress useless tests for mondorestore being a link
  • Property svn:keywords set to Id
File size: 3.0 KB
RevLine 
[1]1#!/bin/sh
2#
[232]3# $Id: post-init 2378 2009-09-09 16:21:15Z bruno $
[1]4#
5#------------------------------------------------------------
6
7sleep 1
8
[2098]9echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
[1315]10cat /tmp/mountlist.txt >> $LOGFILE
[1]11
[2329]12iso=`grep iso $CMDLINE`
13nuke=`grep nuke $CMDLINE`
[1]14if [ "$nuke" = "" ] ; then
[2329]15 nuke=`grep -i "RESTORE " $CMDLINE`
[1]16fi
[2329]17expert=`grep expert $CMDLINE`
18compare=`grep compare $CMDLINE`
19interactive=`grep interactive $CMDLINE`
20pxe=`grep pxe $CMDLINE`
[1]21[ "$interactive" ] && expert=""; # in case 'expert' crops up somewhere
22if which mondorestore > /dev/null 2> /dev/null ; then
23 LogIt "mondorestore found; cool..."
24else
[2098]25 if [ "$iso$nuke$compare$interactive$pxe" != "" ] ; then
[739]26 LogIt "FYI, this CD was made by Mindi, not Mondo." 1
27 exit 0
[1]28 else
[739]29 LogIt "Mindi-Linux has finished booting."
[1]30 fi
31fi
32
33if which bootstrap > /dev/null 2> /dev/null ; then
34 LogIt "Calling bootstrap script" 1
35 bootstrap
36fi
37
[2378]38for i in mount-me unmount-me ; do
[1]39 if which $i > /dev/null 2> /dev/null ; then
40 LogIt "$i found"
41 else
42 LogIt "Warning - $i not found on ramdisk."
43 fi
44done
45
[1962]46mondoopt=""
[1983]47if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
[1962]48 mondoopt="$mondoopt -o -d $TAPEDEV"
49fi
50
[2329]51if [ "`grep -i 'debug' $CMDLINE`" ]; then
[1962]52 mondoopt="$mondoopt -K 99"
53fi
54
[1]55if [ "$compare" ] ; then
56 LogIt "------------------COMPARE MODE-----------------" 1
[1967]57 mondorestore $mondoopt -Z compare
[1]58elif [ "$nuke" ] ; then
59 LogIt "-------------------NUKE MODE-------------------" 1
[1967]60 mondorestore $mondoopt -Z nuke
[1]61elif [ "$expert" ] ; then
[1983]62 if [ "`grep tapedev /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then
[1]63 LogIt "-------------------TAPE MODE-------------------" 1
64 loc=`which mondorestore 2> /dev/null`
65 if [ "$loc" = "" ] ; then
66 LogIt "I presume you backed up with Mindi, not Mondo." 1
67 else
68 LogIt "Tape Mode -- calling mondorestore..."
69 if [ "$nuke" ] ; then
[1967]70 mondorestore $mondoopt -Z nuke
[1]71 else
[1962]72 mondorestore $mondoopt; # MR will detect & access the tape
[1]73 fi
74 fi
[1983]75 elif [ "`grep using-cdstream /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then
[1]76 LogIt "------------------CDSTREAM MODE------------------" 1
77 loc=`which mondorestore 2> /dev/null`
78 if [ "$loc" = "" ] ; then
79 LogIt "I presume you backed up with Mindi, not Mondo." 1
80 else
81 LogIt "Cdstream Mode -- calling mondorestore..."
82 if [ "$nuke" ] ; then
[1967]83 mondorestore -Z nuke $mondoopt
[1]84 else
[1962]85 mondorestore $mondoopt; # MR will detect & access the cdstream
[1]86 fi
87 fi
88 else
[1612]89 LogIt "------------------EXPERT MODE------------------" 1
90 LogIt "You do all the work. :-)" 1
91 if which mondorestore > /dev/null 2> /dev/null ; then
[1]92 LogIt "Type 'mondorestore' to begin the restore/compare process." 1
93 fi
94 fi
95else
96 LogIt "------------------INTERACTIVE------------------" 1
[1967]97 mondorestore -Z interactive $mondoopt
[1]98fi
99
[1967]100[ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore -Z mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1
[1]101
102exit 0
Note: See TracBrowser for help on using the repository browser.