[1] | 1 | #!/bin/sh
|
---|
| 2 | #
|
---|
[232] | 3 | # $Id: post-init 2378 2009-09-09 16:21:15Z bruno $
|
---|
[1] | 4 | #
|
---|
| 5 | #------------------------------------------------------------
|
---|
| 6 |
|
---|
| 7 | sleep 1
|
---|
| 8 |
|
---|
[2098] | 9 | echo "Here is my /tmp/mountlist.txt" >> $LOGFILE
|
---|
[1315] | 10 | cat /tmp/mountlist.txt >> $LOGFILE
|
---|
[1] | 11 |
|
---|
[2329] | 12 | iso=`grep iso $CMDLINE`
|
---|
| 13 | nuke=`grep nuke $CMDLINE`
|
---|
[1] | 14 | if [ "$nuke" = "" ] ; then
|
---|
[2329] | 15 | nuke=`grep -i "RESTORE " $CMDLINE`
|
---|
[1] | 16 | fi
|
---|
[2329] | 17 | expert=`grep expert $CMDLINE`
|
---|
| 18 | compare=`grep compare $CMDLINE`
|
---|
| 19 | interactive=`grep interactive $CMDLINE`
|
---|
| 20 | pxe=`grep pxe $CMDLINE`
|
---|
[1] | 21 | [ "$interactive" ] && expert=""; # in case 'expert' crops up somewhere
|
---|
| 22 | if which mondorestore > /dev/null 2> /dev/null ; then
|
---|
| 23 | LogIt "mondorestore found; cool..."
|
---|
| 24 | else
|
---|
[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
|
---|
| 31 | fi
|
---|
| 32 |
|
---|
| 33 | if which bootstrap > /dev/null 2> /dev/null ; then
|
---|
| 34 | LogIt "Calling bootstrap script" 1
|
---|
| 35 | bootstrap
|
---|
| 36 | fi
|
---|
| 37 |
|
---|
[2378] | 38 | for 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
|
---|
| 44 | done
|
---|
| 45 |
|
---|
[1962] | 46 | mondoopt=""
|
---|
[1983] | 47 | if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
|
---|
[1962] | 48 | mondoopt="$mondoopt -o -d $TAPEDEV"
|
---|
| 49 | fi
|
---|
| 50 |
|
---|
[2329] | 51 | if [ "`grep -i 'debug' $CMDLINE`" ]; then
|
---|
[1962] | 52 | mondoopt="$mondoopt -K 99"
|
---|
| 53 | fi
|
---|
| 54 |
|
---|
[1] | 55 | if [ "$compare" ] ; then
|
---|
| 56 | LogIt "------------------COMPARE MODE-----------------" 1
|
---|
[1967] | 57 | mondorestore $mondoopt -Z compare
|
---|
[1] | 58 | elif [ "$nuke" ] ; then
|
---|
| 59 | LogIt "-------------------NUKE MODE-------------------" 1
|
---|
[1967] | 60 | mondorestore $mondoopt -Z nuke
|
---|
[1] | 61 | elif [ "$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
|
---|
| 95 | else
|
---|
| 96 | LogIt "------------------INTERACTIVE------------------" 1
|
---|
[1967] | 97 | mondorestore -Z interactive $mondoopt
|
---|
[1] | 98 | fi
|
---|
| 99 |
|
---|
[1967] | 100 | [ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore -Z mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1
|
---|
[1] | 101 |
|
---|
| 102 | exit 0
|
---|