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