libDtSearch: Coverity 86579
[oweals/cde.git] / cde / admin / IntegTools / install-cde
1 #!/bin/ksh 
2
3 # File:         install-cde
4 # SCCS:         @(#)install-cde 1.3 95/03/14 SMI;
5 # Author:       Eric Nielsen,  SunSoft Inc, Mountain View, CA.
6 # Created:      02/01/95
7 # Modified by:
8 #                                                          
9 # Language:     ksh
10 # Package:      N/A
11 # Status:       SunSoft CDE distributed
12 #
13 # (c) Copyright 1995, SunSoft Inc, all rights reserved.
14 #
15 # Description:  This script installs SunSoft CDE 1.0                      
16 #
17 # ********************************************************************
18 # ********************************************************************
19 #
20 # The Function Help, which gives you general usage for sunsoft_src
21 # HELP
22 #
23 # ********************************************************************
24  
25 function HELP
26 {
27     cat<<eof
28
29         Usage:install-cde [flags]
30              []                 (No flags invokes menu)
31              [ -loc <dir>]      (Install location for /usr/dt )
32              [ -link  ]         ( Link to the current CDE install )
33              [ -ver ]           (Install packages in interactive mode )
34              [ -noclean ]       (Do not remove old packages before installation)
35              [ -nospace ]       (Do not check available disk space)
36              [ -nocheck ]       (Do not check for /usr/dt directory)
37              [ -nopatches ]     (Do not install patches)
38              [ -nologin ]       (Do not configure desktop login)
39              [ -remove ]        (Remove all CDE packages)
40              [ -min ]           (Install minimium CDE configuration)
41              [ -end ]           (Install min and end-usr CDE configuration)
42              [ -dev ]           (Install min, end-usr and developer configuration)
43              [ -debug ]         (Sets Ksh mode to -xv for debugging/logging)
44              [ -help ]          (Displays this help message)
45              [ ? ]              (Displays this help message)
46
47         Example: install-cde -loc /home/ericni/cde -ver -dev -nospace  
48
49         Note:   Flags can be in any order
50
51 eof
52 exit
53 }
54  
55 # ********************************************************************
56 #
57 #       Function which checks for enought space for packages
58 #            
59 #
60 # ********************************************************************
61
62 function CheckDisk
63 {
64
65
66 $DEBUG
67         if [ ! -d ${SDTHOME}/bin ]
68         then
69                 mkdir -p ${SDTHOME}/bin
70                 if [ $? -ne 0 ]
71 then
72 clear
73 cat <<XYZZY
74 $LINE
75  
76  Error: Could not create $SDTHOME directory. Please verify that
77         you have root permission on the file system located
78         at $SDTHOME
79
80  Hint:  You most likely have an existing /usr/dt link which points to
81         a remote server. If you don't have root permission on
82         this server, you need to manually remove the this link 
83         before running install-cde again.
84           
85  
86                 Press <Enter> to exit..
87 $LINE
88 XYZZY
89  
90                         read
91                         echo "Error: $DATE: The mkdir -p on  $SDTHOME command returned a none zero exit, the directory creation failed" >> $ADMIN_LOG
92                         Exit
93                 fi
94
95                 CDE_CHECK="NO"
96
97         fi
98
99         if [ $CLEAN == "YES" ] 
100         then 
101                 echo "Cleaning up any existing CDE packages..."
102                 if [ "${MIN}" == "YES" ]
103                 then
104                         pkg_del_list="${MIN_RM_PKGS}" 
105                         REMOVE_TT_ONLY="YES"
106                         Tooltalk_min
107                         REMOVE_TT_ONLY="NO"
108                         CLEAN="NO"
109                 fi
110
111                 if [ "${END}" == "YES" ]
112                 then
113                         pkg_del_list="${MIN_RM_PKGS} ${END_RM_PKGS}"
114                         CLEAN="NO"
115                 fi
116
117                 if [ "${DEV}" == "YES" ]
118                 then
119                         pkg_del_list="${MIN_RM_PKGS} ${END_RM_PKGS} ${DEV_RM_PKGS}"
120                         REMOVE_TT_ONLY="YES"
121                         Tooltalk_dev
122                         REMOVE_TT_ONLY="NO"
123                         CLEAN="NO"
124                 fi
125
126                 for pkg in $pkg_del_list
127                 do
128                         /bin/pkginfo -q ${pkg}.*
129                         FOUNDPKG=$?
130                         if [ $FOUNDPKG -eq 0 ]; then
131                                 if [ $VERT == "YES" ]; then
132                                         /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG
133                                 else
134                                         /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG | grep $pkg
135                                 fi
136                         fi
137  
138                 done
139         fi      
140
141
142         if [ ! -d ${SDTHOME}/bin ]
143         then
144                 mkdir -p ${SDTHOME}/bin
145         fi
146
147           diskfree=`df -k ${SDTHOME}/bin | awk '{print $4}' | sed '/avail/d'`
148           if [ $diskfree -lt $SIZE ]
149           then
150
151                 DONE=NO
152                 MENU_SELECT=NO
153                 clear
154  
155                 cat <<XYZZY
156 $LINE
157  
158  Error: $SDTHOME has only `expr $diskfree / 1000` Megabytes of space left,
159         you need `expr $SIZE / 1000` Megabytes for this cde cluster
160  
161         Choose an alternate install location for /usr/dt, or free up
162         `expr $SIZE / 1000`  Megabytes in $SDTHOME.
163  
164  
165                 Press <Enter> to Exit...
166 $LINE
167 XYZZY
168  
169                 read
170                 echo "Error: $DATE: Not enough space in file system to install cde. " >> $ADMIN_LOG
171
172                 EXIT_STATUS=1
173                 Exit
174
175         else
176                 DONE=YES
177                 MENU_SELECT=YES
178         fi
179 }       
180
181 # ********************************************************************
182 #
183 #       Function which configures login                
184 #
185 # ********************************************************************
186
187 function RunDtconfig
188 {
189
190         DONE=YES
191         MENU_SELECT=YES
192
193         if [ -f /usr/dt/bin/dtconfig ]
194         then
195                if [ $VERT == "YES" ]; then
196
197                                 /usr/dt/bin/dtconfig -e 
198                                 DTCONFIG_RESULT=$?
199                        else
200                                 /usr/dt/bin/dtconfig -e 2>&1 > /dev/null
201                                 DTCONFIG_RESULT=$?
202                        fi
203                 if [ $DTCONFIG_RESULT -ne 0 ]
204                 then
205                         clear
206                         cat <<XYZZY
207 $LINE
208  
209  Error: Could not run /usr/dt/bin/dtconfig successfully. The install-cde
210         was unable to setup the Solaris desktop login.
211  
212                 Press <Enter> to exit..
213 $LINE
214 XYZZY
215  
216                         read
217                         echo "Error: $DATE: The install-cde script could not run dtconfig -e correctly" >> $ADMIN_LOG
218                         EXIT_STATUS=1
219                         Exit
220                 fi
221
222         fi
223 }
224
225
226 # ********************************************************************
227 #
228 #       Function which installs minimium CDE packages
229 #
230 # ********************************************************************
231
232 function  InstallMin
233 {
234 $DEBUG
235         DONE=YES
236         MENU_SELECT=YES
237
238
239 if [ $CDE_CHECK == "YES" ]
240 then
241         if [ -f /usr/dt/bin/dtlogin ]
242         then
243  
244                 cat <<XYZZY
245 $LINE
246  
247  Warning: This install program has detected a CDE dtlogin binary, located 
248           at "/usr/dt/bin/dtlogin". If you choose to continue you will destory
249           any current version of CDE that might be present. 
250
251 $LINE
252
253 XYZZY
254                 print -n "\tDo you wish to continue [Y]"
255
256                 read response
257
258                 if [[ $response = `` ]] then response="Y";  fi
259
260                 if [[ $response = "Y" || $response = "y" ]] 
261                 then
262                         echo
263                 else
264                         DONE=NO
265                         MENU_SELECT=NO
266                         EXIT_STATUS=1
267                         Exit
268                 fi
269  
270         fi
271
272 fi
273
274
275 touch /usr/dt/tmp.install.file.$$
276 if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
277 then
278         rm /usr/dt/tmp.install.file.$$
279         clear
280         cat <<XYZZY
281 $LINE
282
283  Error: This machine does not appear to have root permission for
284         the filesystem located at: $SDTHOME
285  
286  
287  Hint:  You most likely have an existing /usr/dt link which points to
288         a remote server. If you don't have root permission on
289         this server, you need to manually remove the this link
290         before running install-cde again.
291  
292  
293                 Press <Enter> to exit..
294 $LINE
295 XYZZY
296  
297         read
298         echo "Error: $DATE: Can not create root permission files in $SDTHOME" >> $ADMIN_LOG
299         EXIT_STATUS=1
300         Exit
301 fi
302
303
304 if [ -d cde-min ]
305 then
306         cd cde-min
307
308
309         SUNWdtcor=
310         if [ "`uname -r`" == "5.5" ]
311         then
312                 if [ ! -h /usr/dt/lib/libtt.so  ]; then  if [ ! -f /usr/dt/lib/libtt.so ]; then
313
314                         SUNWdtcor=SUNWdtcor
315
316                         fi
317                 fi
318         fi
319
320         pkglist="${MIN_PKGS} ${SUNWdtcor}"
321         COPYRIGHT_FIRST_TIME="YES"
322         AddPkgs
323         Tooltalk_min
324         cd $TOP
325         INSTALL_GOOD="YES"
326
327 else
328         DONE=NO
329         MENU_SELECT=NO
330         clear
331  
332         cat <<XYZZY
333 $LINE
334  
335  Error: Can't find the cde-min package directory located on 
336         the CDE cdrom. Be sure you execute this script
337         in the top directory of your CDE cdrom, where the
338         directories: cde-min, cde-end-user, cde-developer and
339         patches should be available.
340  
341         Exit this install script and restart it from the correct
342         location.
343  
344  
345                 Press <Enter> to exit..
346 $LINE
347 XYZZY
348
349         read
350         echo "Error: $DATE: Can not find the cde-min directory, to load min packages" >> $ADMIN_LOG 
351         EXIT_STATUS=1
352         Exit
353 fi
354
355
356
357
358
359 # ####################################################################
360 #
361 #
362 #       Function which installs End User
363 #
364 # ####################################################################
365
366 function InstallEnd
367 {
368 $DEBUG
369 if [ -d cde-end-user ]
370 then
371         pkglist="${END_PKGS}"
372         cd cde-end-user
373         AddPkgs 
374         cd $TOP
375
376 else
377         DONE=NO
378         MENU_SELECT=NO
379         clear
380  
381 cat <<XYZZY
382 $LINE
383  
384  Error: Can't find the cde-end-user package directory located on
385         the CDE cdrom. Be sure you execute this script
386         in the top directory of your CDE cdrom, where the
387         directories: cde-min, cde-end-user, cde-developer and
388         patches should be available.
389  
390         Exit this install script and restart it from the correct
391         location.
392  
393  
394                 Press <Enter> to exit..
395 $LINE
396 XYZZY
397  
398         read
399         echo "Error: $DATE: Can not find the cde-end-user directory, to load end-usr packages" >> $ADMIN_LOG
400         EXIT_STATUS=1
401         Exit
402 fi
403  
404  
405 }
406
407 # ********************************************************************
408 #
409 #       Function which installs cde-developer packages
410 #
411 # ********************************************************************
412
413 function InstallDev
414 {
415 $DEBUG
416 if [ -d cde-developer ]
417 then
418
419 # If we are in 2.5, replace the SUNWmfman & SUNWmfdm if we have previously 
420 # removed it in the create link function
421
422         SUNWmfman=
423         SUNWmfdm=
424         if [ "`uname -r`" == "5.5" ]
425         then
426                 if [ ! -f /usr/dt/share/man/man3/XmActivateProtocol.3x  ]; then  
427  
428                         SUNWmfman=SUNWmfman
429
430                 fi
431
432         fi
433
434         pkglist="${DEV_PKGS} ${SUNWmfman} ${SUNWmfdm}"
435         cd cde-developer
436         AddPkgs 
437         Tooltalk_dev
438         cd $TOP
439  
440 else
441         DONE=NO
442         MENU_SELECT=NO
443         clear
444         cat <<XYZZY
445 $LINE
446  
447  Error: Can't find the cde-developer package directory located on
448         the CDE cdrom. Be sure you execute this script
449         in the top directory of your CDE cdrom, where the
450         directories: cde-min, cde-end-user, cde-developer and
451         patches should be available.
452  
453         Exit this install script and restart it from the correct
454         location.
455  
456  
457                 Press <Enter> to exit..
458 $LINE
459 XYZZY
460  
461         read
462         echo "Error: $DATE: Can not find the cde-developer directory, to load end-usr packages" >> $ADMIN_LOG
463         EXIT_STATUS=1
464         Exit
465 fi
466  
467
468 }
469
470 # ********************************************************************
471 #
472 #       Function which adds packages
473 #       REMOVE
474 #
475 # ********************************************************************
476 function RemoveCDE
477 {
478 $DEBUG
479 REMOVE_TT_ONLY="YES"
480 clear
481 cat <<XYZZY
482 $LINE
483  
484  Warning: This remove program will remove all the CDE packages from 
485           your system.  
486  
487 $LINE
488  
489 XYZZY
490 print -n "\tDo you wish to continue [Y]"
491  
492 read response
493  
494 if [[ $response = `` ]] then response="Y";  fi
495  
496 if [[ $response = "Y" || $response = "y" ]] then
497         echo
498 else
499          Exit
500 fi
501  
502  
503 pkglist="${MIN_RM_PKGS} ${END_RM_PKGS} ${DEV_RM_PKGS}"
504
505 clear
506 if [ -f /usr/dt/bin/dtconfig ]
507 then
508         /usr/dt/bin/dtconfig -e 2>&1 > /dev/null
509 fi
510
511 echo "Starting to Remove Packages..."
512
513 Tooltalk_min
514 Tooltalk_dev
515
516 for pkg in $pkglist
517         do
518                 /bin/pkginfo -q ${pkg}.*
519                 FOUNDPKG=$?
520                 if [ $FOUNDPKG -eq 0 ]; then
521                        if [ $VERT == "YES" ]; then
522                                /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG
523                        else
524                                /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG | grep $pkg
525                        fi
526                 fi
527
528         done
529 Exit
530 }
531
532 # ********************************************************************
533 #
534 #       Function which adds packages
535 #       PKGS
536 #
537 # ********************************************************************
538
539 function AddPkgs
540 {
541 $DEBUG  
542
543         if [ $COPYRIGHT_FIRST_TIME == "YES" ]; then
544                 echo "Starting Install ....."
545         fi
546         for pkg in $pkglist
547         do
548                 if [ $COPYRIGHT_FIRST_TIME == "YES" ]; then
549                         /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG
550                         if [ $? -ne 0 ] ; then
551                                 echo $ERROR_LINE
552                                 echo $ERROR_LINE >> $ADMIN_LOG
553                         fi
554                         COPYRIGHT_FIRST_TIME="NO"
555  
556                 else if [ "$COPYRIGHT_FIRST_TIME" == "NO" ] ; then
557                         if [ $VERT == "YES" ] ; then
558                                 /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG
559                         else
560                                 /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG | grep $pkg
561                         fi
562                      fi
563                 fi
564         done
565
566 }
567
568
569 # ********************************************************************
570 #
571 #       Function which sets install options
572 #
573 # ********************************************************************
574
575
576 function SetOptions
577 {
578 clear
579  
580 cat <<XYZZY
581  
582 $LINE
583  
584  
585         4.  Set Install Options          [ Current ]     [ New ]
586  
587 XYZZY
588 print -n "              Install Location:         [ $SDTHOME ]          [ ]\b\b"
589  
590 read NEW_SDTHOME
591
592 if [ "${NEW_SDTHOME}" == "" ]
593 then 
594         NEW_SDTHOME="/usr/dt"
595 fi
596  
597 firstchar=`echo $NEW_SDTHOME | cut -c1`
598 if [ "$firstchar" != "/" ]
599 then
600                 echo ""
601                 echo ""
602                 echo "\tError: \t $NEW_SDTHOME is not an absolute path, please try again "
603                 echo ""
604                 echo ""
605                 echo "\t\tPress <Enter> to continue...."
606                 read
607                 return
608
609 fi
610 SDTHOME=$NEW_SDTHOME
611
612 print -n "            Remove Old CDE Packages:  [ $CLEAN        ]       [ ]\b\b"
613
614 read NEW_CLEAN
615
616 if [ "${NEW_CLEAN}" != "YES" ] ; then if [ "${NEW_CLEAN}" != "NO" ] ; then if [ "${NEW_CLEAN}" != "" ]
617  then
618         echo ""
619         echo ""
620         echo "\tError: \t You must answer YES or NO ,  please try again "
621         echo ""
622         echo ""
623         echo "\t\tPress <Enter> to continue...."
624         read
625         return
626   fi
627  fi
628 fi
629
630 if [ "$NEW_CLEAN" == "" ] 
631 then
632         CLEAN=YES
633 else
634         CLEAN=$NEW_CLEAN
635 fi
636
637 print -n "            Interactive Installation  [ $VERT         ]       [ ]\b\b"
638
639 read NEW_VERT
640
641 if [ "${NEW_VERT}" != "YES" ] ; then if [ "${NEW_VERT}" != "NO" ] ; then if [ "${NEW_VERT}" != "" ]
642 then
643         echo ""
644         echo ""
645         echo "\tError: \t You must answer YES or NO ,  please try again "
646         echo ""
647         echo ""
648         echo "\t\tPress <Enter> to continue...."
649         read
650         return
651   fi
652  fi
653 fi
654  
655 if [ "${NEW_VERT}" == "" ]
656 then
657         VERT=NO
658         VERBOSE="-n -a /tmp/admin.$$"
659 else
660         VERT=$NEW_VERT
661         if [ $VERT == "YES" ];  then VERBOSE="" ;  fi
662         if [ $VERT == "NO" ];  then VERBOSE="-n -a /tmp/admin.$$" ;  fi
663 fi
664
665 print    "           Solaris Desktop Login       "
666 print -n "                  at System Boot:     [ $DTLOGIN      ]       [ ]\b\b"
667  
668 read NEW_DTLOGIN
669  
670  
671 if [ "${NEW_DTLOGIN}" != "YES" ] ; then if [ "${NEW_DTLOGIN}" != "NO" ] ; then if [ "${NEW_DTLOGIN}" != "" ]
672  then
673         echo ""
674         echo ""
675         echo "\tError: \t You must answer YES or NO ,  please try again "
676         echo ""
677         echo ""
678         echo "\t\tPress <Enter> to continue...."
679         read
680         return
681   fi
682  fi
683 fi
684  
685 if [ "$NEW_DTLOGIN" == "" ]
686 then
687         DTLOGIN=YES
688 else
689         DTLOGIN=$NEW_DTLOGIN
690 fi
691
692
693 }
694
695 # ********************************************************************
696 #
697 #       Function which creates the new install location link
698 #
699 # ********************************************************************
700  
701  
702 function CreateTheLink 
703 {
704 $DEBUG 
705 clear
706
707 if [ -d /usr/dt ]
708 then
709
710         if [ "`uname -r`" == "5.5" ]
711         then
712                 S_R="SUNWdtcor SUNWmfrun SUNWmfman SUNWmfdm"
713                 for i in $S_R
714                 do
715                 echo "Cleaning up Solaris 2.5 $i package from /usr/dt ..."
716                        if [ $VERT == "YES" ]; then
717                           /usr/sbin/pkgrm $VERBOSE ${i}.* 2>&1 | tee -a $PKG_RM_LOG | grep -v no
718                        else
719                           /usr/sbin/pkgrm $VERBOSE ${i}.* 2>&1 | tee -a $PKG_RM_LOG | grep $i | grep -v no 
720                        fi
721                 done
722
723
724         fi
725
726         if [ -d /usr/dt ]
727         then
728
729                 find /usr/dt -depth -exec /bin/rmdir {}  2>&1 > /dev/null \; 2>&1 > /dev/null
730         fi
731
732 fi
733
734 /usr/bin/rm /usr/dt 2>&1 > /dev/null
735
736 if [ -d /usr/dt ]
737 then
738
739
740         clear
741  
742         cat <<XYZZY
743 $LINE
744  
745  Warning:  A "/usr/dt" directory still exists on this machine, this 
746            prohibits a needed link from being setup from 
747
748                 /usr/dt to $SDTHOME  
749
750            This installation can move the current /usr/dt to 
751
752                  /usr/dt.pre.CDE.${DATE} 
753
754            and proceed with the installation.
755
756
757            Do you want to move your current /usr/dt  
758
759  
760 $LINE
761
762
763 XYZZY
764
765                 print -n "\tMove existing /usr/dt directory [Y]"
766
767                 read response
768
769                 if [[ $response = `` ]] then response="Y";  fi
770
771                 if [[ $response = "Y" || $response = "y" ]] 
772                 then
773                         mv /usr/dt /usr/dt.pre.CDE.${DATE}
774                         mkdir -p  ${SDTHOME}
775                         if [ $? -ne 0 ]
776                         then
777                         clear
778 cat <<XYZZY
779 $LINE
780  
781
782  Error: Could not create $SDTHOME directory. Please verify that
783         you have root permission on the file system located
784         at $SDTHOME
785  
786  Hint:  You most likely have an existing /usr/dt link which points to
787         a remote server. If you don't have root permission on
788         this server, you need to manually remove the this link
789         before running install-cde again.
790  
791  
792                 Press <Enter> to exit..
793
794 $LINE
795 XYZZY
796                         EXIT_STATUS=1
797                         Exit
798                         fi
799                         ln -s ${SDTHOME} /usr/dt
800                         if [ $? -ne 0 ]
801                         then 
802                         clear
803                         cat <<XYZZY
804                         $LINE
805                          
806                         Error:  Could not create alternate link from /usr/dt to $SDTHOME , 
807                                 please verfy you have root permission on the file systems
808                                 in question.
809                          
810                          Hint:  You most likely have an existing /usr/dt link which points to
811                                 a remote server. If you don't have root permission on
812                                 this server, you need to manually remove the this link
813                                 before running install-cde again.
814  
815                  
816                                         Press <Enter> to exit..
817                         $LINE
818 XYZZY
819
820                          
821                         read
822                         echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
823                         EXIT_STATUS=1
824                         Exit
825                         fi
826
827                 else
828                         DONE=NO
829                         MENU_SELECT=NO
830                         EXIT_STATUS=1
831                         Exit
832                 fi
833  
834  
835 fi
836
837 if [ -f /usr/dt ]
838 then
839  
840  
841         clear
842  
843         cat <<XYZZY
844 $LINE
845  
846  Warning:  A "/usr/dt" file still exists on this machine, this
847            prohibits a needed link from being setup from
848  
849                 /usr/dt to $SDTHOME
850  
851            This installation can move the current /usr/dt to
852  
853                  /usr/dt.pre.CDE.${DATE}
854  
855            and proceed with the installation.
856  
857            Do you want to move your current /usr/dt 
858  
859  
860 $LINE
861
862
863 XYZZY
864  
865                 print -n "\tMove existing /usr/dt file [Y]"
866  
867                 read response
868  
869                 if [[ $response = `` ]] then response="Y";  fi
870  
871                 if [[ $response = "Y" || $response = "y" ]]
872                 then
873                         mv /usr/dt /usr/dt.pre.CDE.${DATE}
874                         mkdir -p  ${SDTHOME}
875                         if [ $? -ne 0 ]
876                         then
877                         clear
878 cat <<XYZZY
879 $LINE
880  
881  Error: Could not create $SDTHOME directory. Please verify you have
882         you have root permission on the file systems in question.
883  
884
885  Hint:  You most likely have an existing /usr/dt link which points to
886         a remote server. If you don't have root permission on
887         this server, you need to manually remove the this link
888         before running install-cde again.
889  
890  
891                 Press <Enter> to exit..
892 $LINE
893 XYZZY
894                         EXIT_STATUS=1
895                         Exit
896                         fi
897
898                         ln -s ${SDTHOME} /usr/dt
899                         if [ $? -ne 0 ]
900                         then
901                         clear
902                         cat <<XYZZY
903                         $LINE
904  
905                         Error: Could not create alternate link from /usr/dt to $SDTHOME ,
906                                 please verfy you have root permission on the file systems
907                                 in question.
908  
909                         Hint:   You most likely have an existing /usr/dt link which points to
910                                 a remote server. If you don't have root permission on
911                                 this server, you need to manually remove the this link
912                                 before running install-cde again.
913  
914  
915                                         Press <Enter> to exit..
916                         $LINE
917 XYZZY
918  
919  
920                         read
921                         echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link faile
922 d" >> $ADMIN_LOG
923                         EXIT_STATUS=1
924                         Exit
925                         fi
926  
927                 else
928                         DONE=NO
929                         MENU_SELECT=NO
930                         EXIT_STATUS=1
931                         Exit
932                 fi
933  
934  
935 fi
936
937
938
939 mkdir -p  ${SDTHOME}
940 ln -s ${SDTHOME} /usr/dt
941 if [ $? -ne 0 ]
942 then 
943 clear
944 cat <<XYZZY
945 $LINE
946  
947  Error: Could not create alternate link from /usr/dt to $SDTHOME , 
948         please verfy you have root permission on the file systems
949         in question.
950  
951
952
953  Hint:  You most likely have an existing /usr/dt link which points to
954         a remote server. If you don't have root permission on
955         this server, you need to manually remove the this link
956         before running install-cde again.
957  
958  
959                 Press <Enter> to exit..
960 $LINE
961 XYZZY
962  
963 read
964 echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
965 Exit
966 fi
967
968 touch /usr/dt/tmp.install.file.$$
969 if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
970 then
971         rm /usr/dt/tmp.install.file.$$
972         rm /usr/dt
973         clear
974         cat <<XYZZY
975 $LINE
976  
977  Error: This machine does not appear to have root permission for
978         the filesystem located at: $SDTHOME
979  
980  Hint:  You most likely have an existing /usr/dt link which points to
981         a remote server. If you don't have root permission on
982         this server, you need to manually remove the this link
983         before running install-cde again.
984  
985          
986                 Press <Enter> to exit..
987 $LINE
988 XYZZY
989  
990         read
991         echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
992         EXIT_STATUS=1
993         Exit
994 fi
995
996 rm /usr/dt/tmp.install.file.$$
997 MENU_SELECT=NO
998
999
1000
1001
1002 }
1003
1004 # ********************************************************************
1005 #
1006 #       Checks Root permission in /usr/dt file system
1007 #
1008 # ********************************************************************
1009
1010
1011 function CheckRoot
1012
1013 {
1014
1015 touch /usr/dt/tmp.install.file.$$
1016 if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
1017 then
1018         rm /usr/dt/tmp.install.file.$$
1019         clear
1020         cat <<XYZZY
1021 $LINE
1022  
1023  Error: This machine does not appear to have root permission for
1024         the filesystem located at: $SDTHOME
1025  
1026  Hint:  You most likely have an existing /usr/dt link which points to
1027         a remote server. If you don't have root permission on
1028         this server, you need to manually remove the this link
1029         before running install-cde again.
1030  
1031          
1032  
1033                 Press <Enter> to exit..
1034 $LINE
1035 XYZZY
1036  
1037         read
1038         echo "Error: $DATE: Can not create root permission files in $SDTHOME" >> $ADMIN_LOG
1039         EXIT_STATUS=1
1040         Exit
1041 fi
1042  
1043 rm /usr/dt/tmp.install.file.$$
1044 MENU_SELECT=NO
1045
1046 }
1047
1048
1049 # ********************************************************************
1050 #
1051 #       Install Min Cluster Pathces     
1052 #
1053 # ********************************************************************
1054
1055 function MinPatch
1056 {
1057
1058 case "X$(uname -r)" in
1059                 X5.4)
1060
1061                         MIN_PATCHES_sparc=""
1062                         MIN_PATCHES_x86=""
1063
1064                         PATCHES=MIN_PATCHES_${PLATFORM}
1065
1066                 ;;
1067                 *)
1068                 ;;
1069 esac
1070
1071
1072 }
1073
1074
1075 # ********************************************************************
1076 #
1077 #       Install End Cluster Patches     
1078 #
1079 # ********************************************************************
1080
1081 function EndPatch
1082 {
1083
1084
1085 case "X$(uname -r)" in
1086                 X5.4)
1087
1088                 END_PATCHES_sparc="101925-02"
1089                 END_PATCHES_x86="101926-02"
1090
1091                 if [ $PLATFORM == "sparc" ]
1092                 then
1093                         PATCHES=$END_PATCHES_sparc
1094                 else
1095                         PATCHES=$END_PATCHES_x86
1096                 fi
1097
1098                 cd $TOP
1099                  
1100
1101                 for i in $PATCHES
1102                 do
1103                  
1104                         if [ -d Patches/${PLATFORM}/${i} ]
1105                         then
1106
1107                                 if [ `showrev -p | /usr/bin/cut -d" " -f1,2 | grep $i | wc -l` -eq 0 ]
1108                                 then  
1109                                         Patches/${PLATFORM}/${PATCHES}/installpatch `pwd`/Patches/${PLATFORM}/${i} 2>&1 > /dev/null
1110                                         echo "INSTALLED PATCH ${i} "
1111                                 fi
1112                         fi
1113                 done 
1114                 ;;
1115                 *)
1116                 ;;
1117 esac
1118
1119 }
1120
1121 # ********************************************************************
1122 #
1123 #       Install Developer Cluster Patches     
1124 #
1125 # ********************************************************************
1126
1127 function DevPatch
1128 {
1129 case "X$(uname -r)" in
1130                 X5.4)
1131  
1132                         DEV_PATCHES_sparc=""
1133                         DEV_PATCHES_x86=""
1134  
1135                         PATCHES=DEV_PATCHES_${PLATFORM}
1136
1137                 ;;
1138                 *)
1139                 ;;
1140 esac
1141
1142 }
1143
1144 # ********************************************************************
1145 #
1146 #       Install CDE exit function     
1147 #
1148 # ********************************************************************
1149
1150 function Exit
1151 {
1152
1153         cat <<XYZZY
1154
1155 $LINE
1156
1157
1158 XYZZY
1159
1160 if [ -f $ADMIN_LOG ]
1161 then
1162
1163         cat <<XYZZY
1164
1165  
1166 Note:   A install-cde log which has error messages
1167         from the install-cde script can be found at:
1168
1169              install-cde log: $ADMIN_LOG
1170 XYZZY
1171 fi
1172 if [ -f  $PKG_LOG ]
1173 then
1174
1175         cat <<XYZZY
1176
1177  
1178 Note:   A pkgadd log which contains a complete log of all the output
1179         from the "pkgadd" utility can be found at:
1180
1181              pkgadd log: $PKG_LOG
1182 XYZZY
1183 fi
1184 if [ -f $PKG_RM_LOG ]
1185 then
1186
1187         cat <<XYZZY
1188
1189
1190 Note:   A pkgrm log which contains a complete log of all the output
1191         from the "pkgrm" utility can be found at:
1192
1193              pkgrm log: $PKG_RM_LOG 
1194 XYZZY
1195 fi
1196 if [ $INSTALL_GOOD == "YES" ]
1197 then
1198         if [ $SEND_MAIL == "YES" ]
1199         then
1200                 UNAME=`uname -a`
1201                 VERSION=`grep DtVERSION_STRING cde-developer/SUNWdtinc/reloc/dt/share/include/Dt/Dt.h | awk -F\" '{print $2}'`
1202                 SUBJECT=${VERSION}:${UNAME}
1203                 if [ -x /usr/dist/exe/whatami ]
1204                 then 
1205                           /usr/dist/exe/whatami 2>&1 > /tmp/tmp.whatami.$$
1206                 else
1207                         echo "NO /usr/dist/exe/whatami AVAILABLE" > /tmp/tmp.whatami.$$
1208                 fi
1209
1210                 ( cd /tmp; mailx  -s " $SUBJECT " -F cdeinstall@cde-www.Eng.Sun.COM /dev/null  < /tmp/tmp.whatami.$$ 2>&1 > /dev/null )
1211         fi
1212
1213
1214         cat <<XYZZY
1215
1216
1217 Note:   CDE has been installed on this system, please reboot this 
1218         machine before starting CDE
1219
1220 XYZZY
1221 fi
1222
1223         cat <<XYZZY
1224
1225 The install-cde script has completed.
1226 $LINE
1227
1228
1229 XYZZY
1230
1231
1232 exit $EXIT_STATUS
1233 }
1234
1235 # ********************************************************************
1236 #
1237 #       Link to packages.
1238 #
1239 # ********************************************************************
1240
1241 function LinkFunc
1242 {
1243
1244 if [ -d dt ]
1245 then 
1246         if [ -d /usr/dt ]
1247         then
1248            /bin/mv /usr/dt /usr/dt.pre-install-cde.${DATE}
1249         fi
1250
1251         ln -s `pwd`/dt /usr/dt
1252 else
1253
1254          clear
1255          cat <<XYZZY
1256 $LINE
1257  
1258  Error: We could not find the dt directory, are you sure you
1259         are running install-cde from the correct directory. 
1260
1261  
1262                 Press <Enter> to exit..
1263  
1264 $LINE
1265  
1266 XYZZY
1267           read
1268           echo "Error: $DATE: Could not find a dt directory to link to."  >> $ADMIN_LOG
1269           EXIT_STATUS=1
1270           Exit
1271
1272 fi
1273
1274 }
1275
1276 # ****************************************************************************
1277 # *
1278 # *     Determine if it is ok to remove SUNWtltk on 2.4
1279 # *
1280 # ***************************************************************************
1281
1282 function Tooltalk_min
1283 {
1284
1285
1286 case "X$(uname -r)" in
1287                 X5.4)
1288                         
1289                         if [ $CLEAN == "YES" ]; then
1290
1291                                 TTPKG_LIST=`pkginfo | grep SUNWtltk | grep -v SUNWtltkd | grep -v SUNWtltkm | awk '{print $2 }'`
1292                                 for i in $TTPKG_LIST
1293                                 do
1294                                         FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
1295                                         if [ $FOUNDPKG -ne 0 ]; then
1296                                                 if [ $VERT == "YES" ]; then
1297                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
1298                                                 else
1299                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
1300                                                 fi
1301                                                 
1302                                         fi
1303                                 done
1304
1305                         fi
1306
1307                         if [ $REMOVE_TT_ONLY == "NO" ] ; then
1308
1309                                 if [ $VERT == "YES" ] ; then
1310                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltk 2>&1 | tee -a $PKG_LOG
1311                                 else
1312                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltk 2>&1 | tee -a $PKG_LOG | grep SUNWtltk
1313                                 fi
1314                         fi
1315
1316
1317                 ;;
1318  
1319                 *)
1320                 ;;
1321 esac
1322  
1323
1324 }
1325
1326 # ****************************************************************************
1327 # *
1328 # *     Determine if it is ok to remove SUNWtltkm, SUNWtltkd on 2.4
1329 # *
1330 # ***************************************************************************
1331
1332 function Tooltalk_dev
1333 {
1334
1335
1336 case "X$(uname -r)" in
1337                 X5.4)
1338
1339
1340                         if [ $CLEAN == "YES" ]; then
1341
1342                                 TTPKG_LIST=`pkginfo | grep SUNWtltkd | awk '{print $2 }'`
1343                                 for i in $TTPKG_LIST
1344                                 do
1345                                         FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
1346                                         if [ $FOUNDPKG -ne 0 ]; then
1347                                                 if [ $VERT == "YES" ]; then
1348                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
1349                                                 else
1350                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
1351                                                 fi
1352                                         fi
1353                                 done
1354
1355                         fi
1356
1357                         if [ $REMOVE_TT_ONLY == "NO" ] ; then
1358
1359                                 if [ $VERT == "YES" ] ; then
1360                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkd 2>&1 | tee -a $PKG_LOG
1361                                 else
1362                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkd 2>&1 | tee -a $PKG_LOG | grep SUNWtltkd
1363                                 fi
1364                         fi
1365
1366                         if [ $CLEAN == "YES" ]; then
1367
1368                                 TTPKG_LIST=`pkginfo | grep SUNWtltkm | awk '{print $2 }'`
1369                                 for i in $TTPKG_LIST
1370                                 do
1371                                         FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
1372                                         if [ $FOUNDPKG -ne 0 ]; then
1373                                                 if [ $VERT == "YES" ]; then
1374                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
1375                                                 else
1376                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
1377                                                 fi
1378                                         fi
1379                                 done
1380                         fi
1381
1382                         if [ $REMOVE_TT_ONLY == "NO" ] ; then
1383
1384                                         
1385                                 if [ $VERT == "YES" ] ; then
1386                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkm 2>&1 | tee -a $PKG_LOG
1387                                 else
1388                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkm 2>&1 | tee -a $PKG_LOG | grep SUNWtltkm
1389                                 fi
1390                         fi
1391                 ;;
1392  
1393                 *)
1394                 ;;
1395 esac
1396  
1397
1398 }
1399
1400
1401 # ********************************************************************
1402 #
1403 #       Load Package Strings.
1404 #       LOAD
1405 #
1406 # ********************************************************************
1407 function LoadStrings
1408 {
1409 $DEBUG
1410 case "X$(uname -r)" in
1411                 X5.4)
1412
1413                 DEV_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWmfdm SUNWdthed SUNWdtab SUNWdtdem SUNWmfman"
1414                 END_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim" 
1415                 MIN_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn SUNWdtdte SUNWmfrun"
1416
1417                 DEV_RM_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWmfdm SUNWmfdem SUNWdthed SUNWdtab SUNWdtdem SUNWmfman"
1418                 END_RM_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim" 
1419                 MIN_RM_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn SUNWdtdte SUNWmfrun"
1420
1421                 ;;
1422                 X5.5)
1423
1424                 SUNWdtcor=
1425
1426                 if [ ! -h /usr/dt/lib/libtt.so  ]; then  if [ ! -f /usr/dt/lib/libtt.so ]; then
1427         
1428                         SUNWdtcor=SUNWdtcor
1429
1430                         fi
1431                 fi
1432
1433                 /bin/pkginfo -q SUNWtltk.*
1434                 FOUNDPKG=$?
1435                 if [ $FOUNDPKG -ne 0 ]; then
1436                         SUNWtltk=SUNWtltk
1437                         SUNWtltkm=SUNWtltkm
1438                         SUNWtltkd=SUNWtltkd
1439                 else
1440                         SUNWtltk=
1441                         SUNWtltkm=
1442                         SUNWtltkd=
1443                 fi
1444  
1445                 DEV_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWdthed  SUNWdtab SUNWdtdem ${SUNWtltkm} ${SUNWtltkd}"
1446                 END_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim" 
1447                 MIN_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn ${SUNWdtcor} SUNWdtdte SUNWmfrun ${SUNWtltk}"
1448
1449                 DEV_RM_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWdthed  SUNWdtab SUNWdtdem ${SUNWtltkm} ${SUNWtltkd}"
1450                 END_RM_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim"
1451                 MIN_RM_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn  ${SUNWtltk} SUNWdtdte SUNWmfrun"
1452                 ;;
1453                 *)
1454                 clear
1455                 cat <<XYZZY
1456 $LINE
1457  
1458  Error: CDE 1.0 is only supported on SunOS 5.4 and 5.5
1459  
1460  
1461                 Press <Enter> to exit..
1462  
1463 $LINE
1464  
1465 XYZZY
1466                 read
1467                 echo "Error: $DATE: Wrong OS version, uname -r did not return 5.4 or 5.5" >> $ADMIN_LOG
1468                 EXIT_STATUS=1
1469                 Exit
1470                 ;;
1471 esac
1472 }
1473
1474
1475 # ********************************************************************
1476 #
1477 #       Check to be sure user is root
1478 #
1479 # ********************************************************************
1480
1481         USER=`/bin/id | grep root | wc -l`
1482         if [ $USER -eq 0 ]
1483         then
1484
1485                 echo ""
1486                 echo "You must be root to run this script"
1487                 echo ""
1488                 exit 1
1489         fi
1490
1491
1492
1493
1494 # ********************************************************************
1495 #
1496 #       Variable Initialization
1497 #       VARS
1498 #
1499 # ********************************************************************
1500         trap 'rm -f /tmp/admin.$$; rm -f tmp.whatami.$$;  rm -f /usr/dt/tmp.install.file.$$;  exit' INT QUIT TERM EXIT
1501         TOP=`pwd`
1502         CHECK=YES
1503         CDE_CHECK=YES
1504         EXIT_STATUS=0
1505         VERT="NO"
1506         NEW_VERT=
1507         DEBUG=
1508         CLEAN=YES
1509         NEW_CLEAN=
1510         PATCH=YES
1511         DTLOGIN=YES
1512         SDTHOME=/usr/dt
1513         SUNWtltk=
1514         SUNWtltkm=
1515         SUNWtltkd=
1516         NEW_SDTHOME=
1517         MIN=
1518         END=
1519         DEV=
1520         INSTALL_GOOD="NO"
1521         SEND_MAIL="YES"
1522         REMOVE_TT_ONLY="NO"
1523         PLATFORM=`uname -p`
1524         if [ $PLATFORM == "i386" ] 
1525         then
1526                 PLATFORM="x86"
1527         fi      
1528         RELEASE=`uname -r`
1529         DATE=`date '+%d%b%y-%H:%M:%S'`
1530         PATH=/bin:/usr/bin:/etc:/usr/bin
1531         ADMIN_LOG=/usr/tmp/SunSoft_CDE1.0_install.log.${DATE}
1532         PKG_RM_LOG=/usr/tmp/SunSoft_CDE1.0_pkgrm.log.${DATE}
1533         PKG_LOG=/usr/tmp/SunSoft_CDE1.0_pkgadd.log.${DATE}
1534         VERBOSE="-n -a /tmp/admin.$$"
1535         MENU_SELECT=NO
1536         DONE=NO
1537         LINE="____________________________________________________________________________"
1538
1539         cat >/tmp/admin.$$ <<EOF
1540 basedir=default
1541 mail=
1542 runlevel=quit
1543 conflict=nocheck
1544 setuid=nocheck
1545 action=nocheck
1546 partial=nocheck
1547 instance=unique
1548 idepend=nocheck
1549 rdepend=nocheck
1550 space=quit
1551 EOF
1552
1553
1554 # ********************************************************************
1555 #
1556 #       Argument Processing
1557 # ARGS
1558 #
1559 # ********************************************************************
1560
1561         if [ $# -gt 14 ]
1562         then
1563                 HELP $1      # exit on error
1564         fi
1565
1566         while [ $# -gt 0 ]
1567            do case $1 in
1568                 -loc)  SDTHOME=$2;                      shift 2 ;; # install location for /usr/dt
1569                 -link)  LINKDIR=$2 ; LinkFunc ;         exit    ;; 
1570                 -noclean) CLEAN="NO";                   shift   ;;
1571                 -nospace) CHECK="NO";                   shift   ;;
1572                 -nocheck) CDE_CHECK="NO";               shift   ;;
1573                 -nopatches) PATCH="NO";                 shift   ;;
1574                 -nologin) DTLOGIN="NO";                 shift   ;;
1575                 -debug) DEBUG="set -xv";                shift   ;;
1576                 -remove) LoadStrings; RemoveCDE;        exit    ;;
1577                 -help) HELP;                            exit    ;;
1578                 ?) HELP;                                exit    ;;
1579                 -ver)  VERT="YES"; VERBOSE="";          shift   ;;
1580                 -min)  MENU_SELECT="YES"; response="1"; shift   ;;
1581                 -end)  MENU_SELECT="YES"; response="2"; shift   ;;
1582                 -dev)  MENU_SELECT="YES"; response="3"; shift   ;;
1583                 *) HELP $1;                             shift   ;; # exit on error
1584            esac
1585         done
1586
1587
1588 # ********************************************************************
1589 #
1590 #       Place the selection Menu on the screen                     
1591 #
1592 # ********************************************************************
1593
1594 LoadStrings
1595
1596 while [ $DONE = "NO" ]
1597 do
1598 while [ $MENU_SELECT = "NO" ]
1599 do
1600  
1601 clear
1602
1603 cat <<XYZZY
1604 $LINE
1605
1606
1607                 Solaris Common Desktop Environment
1608                         Installation Script
1609                              Beta 1.0
1610
1611 $LINE
1612
1613
1614         1.  Minimum Installation 
1615
1616
1617         2.  CDE End User
1618
1619
1620         3.  Developer & End User
1621
1622
1623         4.  Set Install Options           
1624
1625              Install Location:          [ $SDTHOME ]
1626              Remove Old CDE Packages:   [ $CLEAN        ]
1627              Interactive Installation:  [ $VERT         ]
1628              Solaris Desktop Login 
1629                     at System Boot:     [ $DTLOGIN      ]
1630                         
1631         0.  Cancel Installation 
1632
1633 $LINE
1634
1635
1636 XYZZY
1637 print -n "\tSELECT A NUMBER [2] "
1638
1639 read response
1640 if [[ $response = `` ]] then response="2";  fi
1641  
1642 print ""
1643 print -n "\tYou have selected \"$response\", is this Correct ? (Y/N) [Y]"
1644  
1645 read abort_chance
1646 if [[ $abort_chance = "Y"  ||  $abort_chance = "y" ]] then
1647         MENU_SELECT=YES
1648 fi
1649 if [[ $abort_chance = `` ]] then MENU_SELECT=YES;  fi
1650
1651 clear
1652
1653 done
1654  
1655 if [[ $MENU_SELECT = YES ]] then
1656
1657
1658 case $response in
1659  
1660         "1" )
1661         SIZE=17000
1662         MIN="YES"
1663         if [ $CHECK == "YES" ]  ; then CheckDisk        ; else DONE=YES;  fi
1664         if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES;  fi
1665         if [ $DONE = "YES" ]    ; then InstallMin       ;       fi
1666         if [ $PATCH = "YES" ]   ; then MinPatch         ; else DONE=YES;        fi
1667         if [ $DTLOGIN = "YES" ] ; then RunDtconfig      ; else DONE=YES;        fi
1668         ;;
1669
1670         "2" )
1671         SIZE=35000
1672         MIN="YES"
1673         END="YES"
1674         if [ $CHECK == "YES" ]  ; then CheckDisk        ; else DONE=YES;  fi
1675         if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES;  fi
1676         if [ $DONE = "YES" ]    ; then InstallMin       ;       fi
1677         if [ $DONE = "YES" ]    ; then InstallEnd       ;       fi
1678         if [ $PATCH = "YES" ]   ; then MinPatch         ; else DONE=YES;        fi
1679         if [ $PATCH = "YES" ]   ; then EndPatch         ; else DONE=YES;        fi
1680         if [ $DTLOGIN = "YES" ] ; then RunDtconfig      ; else DONE=YES;        fi
1681         ;;
1682
1683         "3" )
1684         SIZE=60000
1685         MIN="YES"
1686         END="YES"
1687         DEV="YES"
1688         if [ $CHECK == "YES" ]  ; then CheckDisk        ; else DONE=YES;  fi
1689         if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES;  fi
1690         if [ $DONE = "YES" ]    ; then InstallMin       ;       fi
1691         if [ $DONE = "YES" ]    ; then InstallEnd       ;       fi
1692         if [ $DONE = "YES" ]    ; then InstallDev       ;       fi
1693         if [ $PATCH = "YES" ]   ; then MinPatch         ; else DONE=YES;        fi
1694         if [ $PATCH = "YES" ]   ; then EndPatch         ; else DONE=YES;        fi
1695         if [ $PATCH = "YES" ]   ; then DevPatch         ; else DONE=YES;        fi
1696         if [ $DTLOGIN = "YES" ] ; then RunDtconfig      ; else DONE=YES;        fi
1697         ;;
1698
1699         "4" )
1700         SetOptions
1701         MENU_SELECT=NO
1702         ;;
1703
1704         "0" )
1705         DONE="YES"
1706         ;;
1707
1708         *)
1709         print ""
1710         print ""
1711         print "\t\tI don't recogize..\"$response\" Sorry.. "
1712         sleep 2
1713         MENU_SELECT=NO
1714         ;;
1715  
1716 esac
1717 fi
1718
1719 done 
1720 Exit 
1721
1722
1723
1724
1725 # ********************************************************************
1726 #
1727 #       The End
1728 #
1729 ********************************************************************
1730