libDtSearch: Coverity 86579
[oweals/cde.git] / cde / admin / IntegTools / ezinstall.hp
1 #!/bin/ksh
2
3 echo ""
4 echo "ezinstall.hp is a very plain, very vanilla, very simple installation"
5 echo "script that installs the CDE Desktop and executes a set of config-"
6 echo "uration scripts. It assumes that you have set aside ample space - "
7 echo "about 46 Mb - for installation."
8 echo ""
9 echo "The Desktop is installed into the directory /usr/dt. This is the"
10 echo "logical top of CDE. If you wish to change the physical location"
11 echo "of the files, set up a symbolic link between /usr/dt and the actual"
12 echo "location. E.g., if you wish to physically locate the CDE files in"
13 echo "/bigdisk/opt, do a 'ln -s /bigdisk/opt /usr/dt' before executing the"
14 echo "ezinstall.hp script."
15 echo ""
16 echo "Okay?"
17 echo ""
18
19 read response
20
21 if [ `/usr/bin/whoami` != "root" ]
22 then
23      echo ""
24      echo "You must be root to run this script"
25      echo ""
26      exit 1
27 fi
28
29 if [ "$1" = "" -o "$2" = "" ]
30 then
31   echo "Usage: ezinstall <the compressed tar of dt> <the tar of the scripts>"
32   echo "                 [ -clean ]"
33   exit 1
34 fi
35
36 ztar=$1
37 star=$2
38
39 #
40 # have to install in /usr/dt
41 #
42 # clean it first
43 #
44
45 if [ "$3" = "-clean" ]
46 then
47   rm -rf /usr/dt/*
48   rm -rf /var/dt/*
49 fi
50
51 if [ "$1" != "skip" ]
52 then
53   compress -d <$ztar | tar xvf -
54 fi
55
56 #
57 # place the scripts in /tmp/ez
58 #
59
60 mkdir /tmp/ez
61 echo "$PWD: copying $star to /tmp/ez"
62 cp $star /tmp/ez
63
64 cd /tmp/ez
65 tarfile=${star##*/}
66 tar xvf $tarfile
67
68 #
69 # execute each of the scripts
70 #
71
72 for i in config* hp/config*
73 do
74   if [ -f $i ]
75   then
76     if [ ! -x $i ]
77     then
78       chmod 555 $i
79     fi
80     echo "executing $i script"
81     ./$i
82   fi
83 done
84
85 cd /tmp
86 rm -rf /tmp/ez
87
88 echo ""
89 echo "All done!"
90 echo "type /usr/dt/bin/dtlogin to start CDE"
91 echo ""