[1] | 1 | #!/bin/sh
|
---|
| 2 | #
|
---|
[232] | 3 | # $Id: post-init 2329 2009-08-18 13:20:46Z 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 [ -h "`which mondorestore`" ] ; then
|
---|
| 34 | LogIt "Turning mondorestore from a hyperlink into an executable"
|
---|
| 35 | cat `which mondorestore` > /usr/bin/MR
|
---|
| 36 | # in case there's more than one instance :)
|
---|
| 37 | rm -f `which mondorestore 2> /dev/null`
|
---|
| 38 | rm -f `which mondorestore 2> /dev/null`
|
---|
| 39 | rm -f `which mondorestore 2> /dev/null`
|
---|
| 40 | rm -f `which mondorestore 2> /dev/null`
|
---|
| 41 | mv /usr/bin/MR /usr/bin/mondorestore
|
---|
| 42 | chmod +x /usr/bin/mondorestore
|
---|
| 43 | fi
|
---|
| 44 |
|
---|
| 45 | if which bootstrap > /dev/null 2> /dev/null ; then
|
---|
| 46 | LogIt "Calling bootstrap script" 1
|
---|
| 47 | bootstrap
|
---|
| 48 | fi
|
---|
| 49 |
|
---|
| 50 | for i in mount-me unmount-me mondorestore ; do
|
---|
| 51 | if which $i > /dev/null 2> /dev/null ; then
|
---|
| 52 | LogIt "$i found"
|
---|
| 53 | else
|
---|
| 54 | LogIt "Warning - $i not found on ramdisk."
|
---|
| 55 | fi
|
---|
| 56 | done
|
---|
| 57 |
|
---|
[1962] | 58 | mondoopt=""
|
---|
[1983] | 59 | if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2> /dev/null`" ]; then
|
---|
[1962] | 60 | mondoopt="$mondoopt -o -d $TAPEDEV"
|
---|
| 61 | fi
|
---|
| 62 |
|
---|
[2329] | 63 | if [ "`grep -i 'debug' $CMDLINE`" ]; then
|
---|
[1962] | 64 | mondoopt="$mondoopt -K 99"
|
---|
| 65 | fi
|
---|
| 66 |
|
---|
[1] | 67 | if [ "$compare" ] ; then
|
---|
| 68 | LogIt "------------------COMPARE MODE-----------------" 1
|
---|
[1967] | 69 | mondorestore $mondoopt -Z compare
|
---|
[1] | 70 | elif [ "$nuke" ] ; then
|
---|
| 71 | LogIt "-------------------NUKE MODE-------------------" 1
|
---|
[1967] | 72 | mondorestore $mondoopt -Z nuke
|
---|
[1] | 73 | elif [ "$expert" ] ; then
|
---|
[1983] | 74 | if [ "`grep tapedev /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then
|
---|
[1] | 75 | LogIt "-------------------TAPE MODE-------------------" 1
|
---|
| 76 | loc=`which mondorestore 2> /dev/null`
|
---|
| 77 | if [ "$loc" = "" ] ; then
|
---|
| 78 | LogIt "I presume you backed up with Mindi, not Mondo." 1
|
---|
| 79 | else
|
---|
| 80 | LogIt "Tape Mode -- calling mondorestore..."
|
---|
| 81 | if [ "$nuke" ] ; then
|
---|
[1967] | 82 | mondorestore $mondoopt -Z nuke
|
---|
[1] | 83 | else
|
---|
[1962] | 84 | mondorestore $mondoopt; # MR will detect & access the tape
|
---|
[1] | 85 | fi
|
---|
| 86 | fi
|
---|
[1983] | 87 | elif [ "`grep using-cdstream /tmp/mondo-restore.cfg 2> /dev/null`" ] ; then
|
---|
[1] | 88 | LogIt "------------------CDSTREAM MODE------------------" 1
|
---|
| 89 | loc=`which mondorestore 2> /dev/null`
|
---|
| 90 | if [ "$loc" = "" ] ; then
|
---|
| 91 | LogIt "I presume you backed up with Mindi, not Mondo." 1
|
---|
| 92 | else
|
---|
| 93 | LogIt "Cdstream Mode -- calling mondorestore..."
|
---|
| 94 | if [ "$nuke" ] ; then
|
---|
[1967] | 95 | mondorestore -Z nuke $mondoopt
|
---|
[1] | 96 | else
|
---|
[1962] | 97 | mondorestore $mondoopt; # MR will detect & access the cdstream
|
---|
[1] | 98 | fi
|
---|
| 99 | fi
|
---|
| 100 | else
|
---|
[1612] | 101 | LogIt "------------------EXPERT MODE------------------" 1
|
---|
| 102 | LogIt "You do all the work. :-)" 1
|
---|
| 103 | if which mondorestore > /dev/null 2> /dev/null ; then
|
---|
[1] | 104 | LogIt "Type 'mondorestore' to begin the restore/compare process." 1
|
---|
| 105 | fi
|
---|
| 106 | fi
|
---|
| 107 | else
|
---|
| 108 | LogIt "------------------INTERACTIVE------------------" 1
|
---|
[1967] | 109 | mondorestore -Z interactive $mondoopt
|
---|
[1] | 110 | fi
|
---|
| 111 |
|
---|
[1967] | 112 | [ -e "/tmp/DO-MBR-PLEASE" ] && LogIt "PLEASE RUN 'mondorestore -Z mbr' NOW TO INITIALIZE YOUR BOOT SECTOR." 1
|
---|
[1] | 113 |
|
---|
| 114 | exit 0
|
---|