source: MondoRescue/branches/3.3/mindi/rootfs/usr/sbin/install-additional-tools@ 3697

Last change on this file since 3697 was 3697, checked in by Bruno Cornec, 6 years ago

Remove usage of groovy word to clarify what is done

  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[1]1#!/bin/sh
2#
[866]3# $Id: install-additional-tools 3697 2018-01-07 13:52:31Z bruno $
[1]4#
5########################################################################
6
7
8# ------------ main -----------
9
10# if the file '/tmp/CDROM-LIVES-HERE' exists then we should use the CD
11
12LogIt "Starting install-additional-tools"
[1997]13
[3697]14mountdir=$EXTRACTDIR
[1997]15
[1998]16if [ $mountdir = "/" ]; then
17 LogIt "mountdir shouldn't be /"
18 exit 1
19fi
20
[1734]21# Should be the same as in mindi => conf param
[1]22mkdir -p $mountdir
23res=0
24if [ -e "/tmp/TAPEDEV-HAS-DATA-DISKS" ] ; then
25 LogIt "I am assuming the data disks' contents are already in $mountdir."
26else
[1902]27 LogIt "PLEASE WAIT. Untarring data content" 2
28
29 mountpoint=/dev/null
30 [ -e "/tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images
31 tarball=$mountpoint/all.tar.gz
32 if [ -e "/tmp/CDROM-LIVES-HERE" ] ; then
33 [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1
34 fi
35
36 old_pwd=`pwd`
37 cd $mountdir
38 counter=0
39 for fname in `tar -zxvf $tarball` ; do
40 counter=$(($counter+1))
41 [ "$(($counter % 4))" -eq "0" ] && echo -en "\r\t\t\t\t\t\t\t\\"
42 [ "$(($counter % 4))" -eq "1" ] && echo -en "\r\t\t\t\t\t\t\t|"
43 [ "$(($counter % 4))" -eq "2" ] && echo -en "\r\t\t\t\t\t\t\t/"
44 [ "$(($counter % 4))" -eq "3" ] && echo -en "\r\t\t\t\t\t\t\t-"
45 done
46 cd $old_pwd
47 echo -e -n "\r"
[2878]48 [ ! -e "/tmp/CDROM-LIVES-HERE" ] && umount -d $mountpoint
[1902]49 sleep 1
[1]50fi
51
[1734]52LogIt "Populating / with tar file content..." 1
[1]53
54cd $mountdir
[1748]55if [ -f etc/fstab ]; then
[1841]56 cp etc/fstab /tmp
[1748]57fi
58if [ -f etc/raidtab ]; then
[1841]59 cp etc/raidtab /tmp
[1748]60fi
[1]61
[1734]62liste=`ls`
63if [ "$liste" ]; then
[2363]64 LogIt "Installing and removing $liste"
[1734]65 tar cf - $liste | (cd / ; tar xf -)
66 rm -fr $liste
67fi
[229]68cd /
[1]69
70sync;sync;sync
71
[1734]72LogIt "Done." 1
[1]73
74which gawk 2> /dev/null > /dev/null
75[ "$?" -ne "0" ] && which awk 2> /dev/null > /dev/null && ln -sf `which awk` /usr/bin/gawk
76
77LogIt "Exiting install-additional-tools"
78exit 0
Note: See TracBrowser for help on using the repository browser.