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