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

Last change on this file since 3621 was 3216, checked in by Bruno Cornec, 10 years ago
  • Moves all mindi scripts under /usr/sbin to be more easily compatible with the lack of /sbin in recent distros.
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#!/bin/sh
2#
3# $Id: install-additional-tools 3216 2013-12-30 09:46:14Z bruno $
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"
13
14if [ ! "$GROOVY" ] ; then
15 LogIt "I'm not groovy!"
16 exit 1
17fi
18
19mountdir=$GROOVY
20
21if [ $mountdir = "/" ]; then
22 LogIt "mountdir shouldn't be /"
23 exit 1
24fi
25
26# Should be the same as in mindi => conf param
27mkdir -p $mountdir
28res=0
29if [ -e "/tmp/TAPEDEV-HAS-DATA-DISKS" ] ; then
30 LogIt "I am assuming the data disks' contents are already in $mountdir."
31else
32 LogIt "PLEASE WAIT. Untarring data content" 2
33
34 mountpoint=/dev/null
35 [ -e "/tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images
36 tarball=$mountpoint/all.tar.gz
37 if [ -e "/tmp/CDROM-LIVES-HERE" ] ; then
38 [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1
39 fi
40
41 old_pwd=`pwd`
42 cd $mountdir
43 counter=0
44 for fname in `tar -zxvf $tarball` ; do
45 counter=$(($counter+1))
46 [ "$(($counter % 4))" -eq "0" ] && echo -en "\r\t\t\t\t\t\t\t\\"
47 [ "$(($counter % 4))" -eq "1" ] && echo -en "\r\t\t\t\t\t\t\t|"
48 [ "$(($counter % 4))" -eq "2" ] && echo -en "\r\t\t\t\t\t\t\t/"
49 [ "$(($counter % 4))" -eq "3" ] && echo -en "\r\t\t\t\t\t\t\t-"
50 done
51 cd $old_pwd
52 echo -e -n "\r"
53 [ ! -e "/tmp/CDROM-LIVES-HERE" ] && umount -d $mountpoint
54 sleep 1
55fi
56
57LogIt "Populating / with tar file content..." 1
58
59cd $mountdir
60if [ -f etc/fstab ]; then
61 cp etc/fstab /tmp
62fi
63if [ -f etc/raidtab ]; then
64 cp etc/raidtab /tmp
65fi
66
67liste=`ls`
68if [ "$liste" ]; then
69 LogIt "Installing and removing $liste"
70 tar cf - $liste | (cd / ; tar xf -)
71 rm -fr $liste
72fi
73cd /
74
75sync;sync;sync
76
77LogIt "Done." 1
78
79which gawk 2> /dev/null > /dev/null
80[ "$?" -ne "0" ] && which awk 2> /dev/null > /dev/null && ln -sf `which awk` /usr/bin/gawk
81
82LogIt "Exiting install-additional-tools"
83exit 0
Note: See TracBrowser for help on using the repository browser.