-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·69 lines (63 loc) · 1.1 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh
CMD=`basename $0`
if [ $# -ne 1 ]
then
echo
echo "$CMD unwinds the Inferno tar file in the <inferno_root> directory"
echo
echo "Usage: $CMD <inferno_root>"
echo
echo " Where <inferno_root> is the inferno root directory"
echo
echo " eg. \"$CMD /usr/inferno\""
echo
exit 1
fi
TDIR=$1
TNAME=`basename $1`
if [ ! "$TNAME" = "inferno" ]
then
TDIR=$1/inferno
fi
TDIR0=`dirname $TDIR`
#look for the tar file
TAR=`dirname $0`/inferno.tar
if [ ! -f $TAR ]
then
echo "ERROR: can't find tar file $TAR, exit 2"
exit 2
fi
#will this overwrite anything?
if [ -d $TDIR/dis ]
then
echo "Files exist in $TDIR ! Do you want to overwrite them?"
echo "enter y or n"
read ans
if [ ! "$ans" = "y" ]
then
echo inferno not installed exit 3
exit 3
fi
fi
if [ ! -d $TDIR ]
then
mkdir $TDIR
if [ "$?" -ne "0" ]
then
echo "ERROR: can't make $TDIR, exit 4"
exit 4
fi
fi
if [ ! -w $TDIR ]
then
echo "ERROR: $TDIR not writeable, exit 5"
exit 5
fi
cd $TDIR0
echo "Unwinding the tar file, this will take a while!"
tar xopf $BASE/$TAR
if [ "$?" -ne "0" ]
then
echo "ERROR: tar failed, exit 6"
exit 6
fi