Allow building on FreeBSD
[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                 if [ ! -f /usr/dt/share/examples/motif/dogs/Dog.c  ]; then  
433   
434                         SUNWmfdm=SUNWmfdm 
435  
436                 fi
437
438         fi
439
440         pkglist="${DEV_PKGS} ${SUNWmfman} ${SUNWmfdm}"
441         cd cde-developer
442         AddPkgs 
443         Tooltalk_dev
444         cd $TOP
445  
446 else
447         DONE=NO
448         MENU_SELECT=NO
449         clear
450         cat <<XYZZY
451 $LINE
452  
453  Error: Can't find the cde-developer package directory located on
454         the CDE cdrom. Be sure you execute this script
455         in the top directory of your CDE cdrom, where the
456         directories: cde-min, cde-end-user, cde-developer and
457         patches should be available.
458  
459         Exit this install script and restart it from the correct
460         location.
461  
462  
463                 Press <Enter> to exit..
464 $LINE
465 XYZZY
466  
467         read
468         echo "Error: $DATE: Can not find the cde-developer directory, to load end-usr packages" >> $ADMIN_LOG
469         EXIT_STATUS=1
470         Exit
471 fi
472  
473
474 }
475
476 # ********************************************************************
477 #
478 #       Function which adds packages
479 #       REMOVE
480 #
481 # ********************************************************************
482 function RemoveCDE
483 {
484 $DEBUG
485 REMOVE_TT_ONLY="YES"
486 clear
487 cat <<XYZZY
488 $LINE
489  
490  Warning: This remove program will remove all the CDE packages from 
491           your system.  
492  
493 $LINE
494  
495 XYZZY
496 print -n "\tDo you wish to continue [Y]"
497  
498 read response
499  
500 if [[ $response = `` ]] then response="Y";  fi
501  
502 if [[ $response = "Y" || $response = "y" ]] then
503         echo
504 else
505          Exit
506 fi
507  
508  
509 pkglist="${MIN_RM_PKGS} ${END_RM_PKGS} ${DEV_RM_PKGS}"
510
511 clear
512 if [ -f /usr/dt/bin/dtconfig ]
513 then
514         /usr/dt/bin/dtconfig -e 2>&1 > /dev/null
515 fi
516
517 echo "Starting to Remove Packages..."
518
519 Tooltalk_min
520 Tooltalk_dev
521
522 for pkg in $pkglist
523         do
524                 /bin/pkginfo -q ${pkg}.*
525                 FOUNDPKG=$?
526                 if [ $FOUNDPKG -eq 0 ]; then
527                        if [ $VERT == "YES" ]; then
528                                /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG
529                        else
530                                /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG | grep $pkg
531                        fi
532                 fi
533
534         done
535 Exit
536 }
537
538 # ********************************************************************
539 #
540 #       Function which adds packages
541 #       PKGS
542 #
543 # ********************************************************************
544
545 function AddPkgs
546 {
547 $DEBUG  
548
549         if [ $COPYRIGHT_FIRST_TIME == "YES" ]; then
550                 echo "Starting Install ....."
551         fi
552         for pkg in $pkglist
553         do
554                 if [ $COPYRIGHT_FIRST_TIME == "YES" ]; then
555                         /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG
556                         if [ $? -ne 0 ] ; then
557                                 echo $ERROR_LINE
558                                 echo $ERROR_LINE >> $ADMIN_LOG
559                         fi
560                         COPYRIGHT_FIRST_TIME="NO"
561  
562                 else if [ "$COPYRIGHT_FIRST_TIME" == "NO" ] ; then
563                         if [ $VERT == "YES" ] ; then
564                                 /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG
565                         else
566                                 /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG | grep $pkg
567                         fi
568                      fi
569                 fi
570         done
571
572 }
573
574
575 # ********************************************************************
576 #
577 #       Function which sets install options
578 #
579 # ********************************************************************
580
581
582 function SetOptions
583 {
584 clear
585  
586 cat <<XYZZY
587  
588 $LINE
589  
590  
591         4.  Set Install Options          [ Current ]     [ New ]
592  
593 XYZZY
594 print -n "              Install Location:         [ $SDTHOME ]          [ ]\b\b"
595  
596 read NEW_SDTHOME
597
598 if [ "${NEW_SDTHOME}" == "" ]
599 then 
600         NEW_SDTHOME="/usr/dt"
601 fi
602  
603 firstchar=`echo $NEW_SDTHOME | cut -c1`
604 if [ "$firstchar" != "/" ]
605 then
606                 echo ""
607                 echo ""
608                 echo "\tError: \t $NEW_SDTHOME is not an absolute path, please try again "
609                 echo ""
610                 echo ""
611                 echo "\t\tPress <Enter> to continue...."
612                 read
613                 return
614
615 fi
616 SDTHOME=$NEW_SDTHOME
617
618 print -n "            Remove Old CDE Packages:  [ $CLEAN        ]       [ ]\b\b"
619
620 read NEW_CLEAN
621
622 if [ "${NEW_CLEAN}" != "YES" ] ; then if [ "${NEW_CLEAN}" != "NO" ] ; then if [ "${NEW_CLEAN}" != "" ]
623  then
624         echo ""
625         echo ""
626         echo "\tError: \t You must answer YES or NO ,  please try again "
627         echo ""
628         echo ""
629         echo "\t\tPress <Enter> to continue...."
630         read
631         return
632   fi
633  fi
634 fi
635
636 if [ "$NEW_CLEAN" == "" ] 
637 then
638         CLEAN=YES
639 else
640         CLEAN=$NEW_CLEAN
641 fi
642
643 print -n "            Interactive Installation  [ $VERT         ]       [ ]\b\b"
644
645 read NEW_VERT
646
647 if [ "${NEW_VERT}" != "YES" ] ; then if [ "${NEW_VERT}" != "NO" ] ; then if [ "${NEW_VERT}" != "" ]
648 then
649         echo ""
650         echo ""
651         echo "\tError: \t You must answer YES or NO ,  please try again "
652         echo ""
653         echo ""
654         echo "\t\tPress <Enter> to continue...."
655         read
656         return
657   fi
658  fi
659 fi
660  
661 if [ "${NEW_VERT}" == "" ]
662 then
663         VERT=NO
664         VERBOSE="-n -a /tmp/admin.$$"
665 else
666         VERT=$NEW_VERT
667         if [ $VERT == "YES" ];  then VERBOSE="" ;  fi
668         if [ $VERT == "NO" ];  then VERBOSE="-n -a /tmp/admin.$$" ;  fi
669 fi
670
671 print    "           Solaris Desktop Login       "
672 print -n "                  at System Boot:     [ $DTLOGIN      ]       [ ]\b\b"
673  
674 read NEW_DTLOGIN
675  
676  
677 if [ "${NEW_DTLOGIN}" != "YES" ] ; then if [ "${NEW_DTLOGIN}" != "NO" ] ; then if [ "${NEW_DTLOGIN}" != "" ]
678  then
679         echo ""
680         echo ""
681         echo "\tError: \t You must answer YES or NO ,  please try again "
682         echo ""
683         echo ""
684         echo "\t\tPress <Enter> to continue...."
685         read
686         return
687   fi
688  fi
689 fi
690  
691 if [ "$NEW_DTLOGIN" == "" ]
692 then
693         DTLOGIN=YES
694 else
695         DTLOGIN=$NEW_DTLOGIN
696 fi
697
698
699 }
700
701 # ********************************************************************
702 #
703 #       Function which creates the new install location link
704 #
705 # ********************************************************************
706  
707  
708 function CreateTheLink 
709 {
710 $DEBUG 
711 clear
712
713 if [ -d /usr/dt ]
714 then
715
716         if [ "`uname -r`" == "5.5" ]
717         then
718                 S_R="SUNWdtcor SUNWmfrun SUNWmfman SUNWmfdm"
719                 for i in $S_R
720                 do
721                 echo "Cleaning up Solaris 2.5 $i package from /usr/dt ..."
722                        if [ $VERT == "YES" ]; then
723                           /usr/sbin/pkgrm $VERBOSE ${i}.* 2>&1 | tee -a $PKG_RM_LOG | grep -v no
724                        else
725                           /usr/sbin/pkgrm $VERBOSE ${i}.* 2>&1 | tee -a $PKG_RM_LOG | grep $i | grep -v no 
726                        fi
727                 done
728
729
730         fi
731
732         if [ -d /usr/dt ]
733         then
734
735                 find /usr/dt -depth -exec /bin/rmdir {}  2>&1 > /dev/null \; 2>&1 > /dev/null
736         fi
737
738 fi
739
740 /usr/bin/rm /usr/dt 2>&1 > /dev/null
741
742 if [ -d /usr/dt ]
743 then
744
745
746         clear
747  
748         cat <<XYZZY
749 $LINE
750  
751  Warning:  A "/usr/dt" directory still exists on this machine, this 
752            prohibits a needed link from being setup from 
753
754                 /usr/dt to $SDTHOME  
755
756            This installation can move the current /usr/dt to 
757
758                  /usr/dt.pre.CDE.${DATE} 
759
760            and proceed with the installation.
761
762
763            Do you want to move your current /usr/dt  
764
765  
766 $LINE
767
768
769 XYZZY
770
771                 print -n "\tMove existing /usr/dt directory [Y]"
772
773                 read response
774
775                 if [[ $response = `` ]] then response="Y";  fi
776
777                 if [[ $response = "Y" || $response = "y" ]] 
778                 then
779                         mv /usr/dt /usr/dt.pre.CDE.${DATE}
780                         mkdir -p  ${SDTHOME}
781                         if [ $? -ne 0 ]
782                         then
783                         clear
784 cat <<XYZZY
785 $LINE
786  
787
788  Error: Could not create $SDTHOME directory. Please verify that
789         you have root permission on the file system located
790         at $SDTHOME
791  
792  Hint:  You most likely have an existing /usr/dt link which points to
793         a remote server. If you don't have root permission on
794         this server, you need to manually remove the this link
795         before running install-cde again.
796  
797  
798                 Press <Enter> to exit..
799
800 $LINE
801 XYZZY
802                         EXIT_STATUS=1
803                         Exit
804                         fi
805                         ln -s ${SDTHOME} /usr/dt
806                         if [ $? -ne 0 ]
807                         then 
808                         clear
809                         cat <<XYZZY
810                         $LINE
811                          
812                         Error:  Could not create alternate link from /usr/dt to $SDTHOME , 
813                                 please verfy you have root permission on the file systems
814                                 in question.
815                          
816                          Hint:  You most likely have an existing /usr/dt link which points to
817                                 a remote server. If you don't have root permission on
818                                 this server, you need to manually remove the this link
819                                 before running install-cde again.
820  
821                  
822                                         Press <Enter> to exit..
823                         $LINE
824 XYZZY
825
826                          
827                         read
828                         echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
829                         EXIT_STATUS=1
830                         Exit
831                         fi
832
833                 else
834                         DONE=NO
835                         MENU_SELECT=NO
836                         EXIT_STATUS=1
837                         Exit
838                 fi
839  
840  
841 fi
842
843 if [ -f /usr/dt ]
844 then
845  
846  
847         clear
848  
849         cat <<XYZZY
850 $LINE
851  
852  Warning:  A "/usr/dt" file still exists on this machine, this
853            prohibits a needed link from being setup from
854  
855                 /usr/dt to $SDTHOME
856  
857            This installation can move the current /usr/dt to
858  
859                  /usr/dt.pre.CDE.${DATE}
860  
861            and proceed with the installation.
862  
863            Do you want to move your current /usr/dt 
864  
865  
866 $LINE
867
868
869 XYZZY
870  
871                 print -n "\tMove existing /usr/dt file [Y]"
872  
873                 read response
874  
875                 if [[ $response = `` ]] then response="Y";  fi
876  
877                 if [[ $response = "Y" || $response = "y" ]]
878                 then
879                         mv /usr/dt /usr/dt.pre.CDE.${DATE}
880                         mkdir -p  ${SDTHOME}
881                         if [ $? -ne 0 ]
882                         then
883                         clear
884 cat <<XYZZY
885 $LINE
886  
887  Error: Could not create $SDTHOME directory. Please verify you have
888         you have root permission on the file systems in question.
889  
890
891  Hint:  You most likely have an existing /usr/dt link which points to
892         a remote server. If you don't have root permission on
893         this server, you need to manually remove the this link
894         before running install-cde again.
895  
896  
897                 Press <Enter> to exit..
898 $LINE
899 XYZZY
900                         EXIT_STATUS=1
901                         Exit
902                         fi
903
904                         ln -s ${SDTHOME} /usr/dt
905                         if [ $? -ne 0 ]
906                         then
907                         clear
908                         cat <<XYZZY
909                         $LINE
910  
911                         Error: Could not create alternate link from /usr/dt to $SDTHOME ,
912                                 please verfy you have root permission on the file systems
913                                 in question.
914  
915                         Hint:   You most likely have an existing /usr/dt link which points to
916                                 a remote server. If you don't have root permission on
917                                 this server, you need to manually remove the this link
918                                 before running install-cde again.
919  
920  
921                                         Press <Enter> to exit..
922                         $LINE
923 XYZZY
924  
925  
926                         read
927                         echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link faile
928 d" >> $ADMIN_LOG
929                         EXIT_STATUS=1
930                         Exit
931                         fi
932  
933                 else
934                         DONE=NO
935                         MENU_SELECT=NO
936                         EXIT_STATUS=1
937                         Exit
938                 fi
939  
940  
941 fi
942
943
944
945 mkdir -p  ${SDTHOME}
946 ln -s ${SDTHOME} /usr/dt
947 if [ $? -ne 0 ]
948 then 
949 clear
950 cat <<XYZZY
951 $LINE
952  
953  Error: Could not create alternate link from /usr/dt to $SDTHOME , 
954         please verfy you have root permission on the file systems
955         in question.
956  
957
958
959  Hint:  You most likely have an existing /usr/dt link which points to
960         a remote server. If you don't have root permission on
961         this server, you need to manually remove the this link
962         before running install-cde again.
963  
964  
965                 Press <Enter> to exit..
966 $LINE
967 XYZZY
968  
969 read
970 echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
971 Exit
972 fi
973
974 touch /usr/dt/tmp.install.file.$$
975 if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
976 then
977         rm /usr/dt/tmp.install.file.$$
978         rm /usr/dt
979         clear
980         cat <<XYZZY
981 $LINE
982  
983  Error: This machine does not appear to have root permission for
984         the filesystem located at: $SDTHOME
985  
986  Hint:  You most likely have an existing /usr/dt link which points to
987         a remote server. If you don't have root permission on
988         this server, you need to manually remove the this link
989         before running install-cde again.
990  
991          
992                 Press <Enter> to exit..
993 $LINE
994 XYZZY
995  
996         read
997         echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
998         EXIT_STATUS=1
999         Exit
1000 fi
1001
1002 rm /usr/dt/tmp.install.file.$$
1003 MENU_SELECT=NO
1004
1005
1006
1007
1008 }
1009
1010 # ********************************************************************
1011 #
1012 #       Checks Root permission in /usr/dt file system
1013 #
1014 # ********************************************************************
1015
1016
1017 function CheckRoot
1018
1019 {
1020
1021 touch /usr/dt/tmp.install.file.$$
1022 if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
1023 then
1024         rm /usr/dt/tmp.install.file.$$
1025         clear
1026         cat <<XYZZY
1027 $LINE
1028  
1029  Error: This machine does not appear to have root permission for
1030         the filesystem located at: $SDTHOME
1031  
1032  Hint:  You most likely have an existing /usr/dt link which points to
1033         a remote server. If you don't have root permission on
1034         this server, you need to manually remove the this link
1035         before running install-cde again.
1036  
1037          
1038  
1039                 Press <Enter> to exit..
1040 $LINE
1041 XYZZY
1042  
1043         read
1044         echo "Error: $DATE: Can not create root permission files in $SDTHOME" >> $ADMIN_LOG
1045         EXIT_STATUS=1
1046         Exit
1047 fi
1048  
1049 rm /usr/dt/tmp.install.file.$$
1050 MENU_SELECT=NO
1051
1052 }
1053
1054
1055 # ********************************************************************
1056 #
1057 #       Install Min Cluster Pathces     
1058 #
1059 # ********************************************************************
1060
1061 function MinPatch
1062 {
1063
1064 case "X$(uname -r)" in
1065                 X5.4)
1066
1067                         MIN_PATCHES_sparc=""
1068                         MIN_PATCHES_x86=""
1069
1070                         PATCHES=MIN_PATCHES_${PLATFORM}
1071
1072                 ;;
1073                 *)
1074                 ;;
1075 esac
1076
1077
1078 }
1079
1080
1081 # ********************************************************************
1082 #
1083 #       Install End Cluster Patches     
1084 #
1085 # ********************************************************************
1086
1087 function EndPatch
1088 {
1089
1090
1091 case "X$(uname -r)" in
1092                 X5.4)
1093
1094                 END_PATCHES_sparc="101925-02"
1095                 END_PATCHES_x86="101926-02"
1096
1097                 if [ $PLATFORM == "sparc" ]
1098                 then
1099                         PATCHES=$END_PATCHES_sparc
1100                 else
1101                         PATCHES=$END_PATCHES_x86
1102                 fi
1103
1104                 cd $TOP
1105                  
1106
1107                 for i in $PATCHES
1108                 do
1109                  
1110                         if [ -d Patches/${PLATFORM}/${i} ]
1111                         then
1112
1113                                 if [ `showrev -p | /usr/bin/cut -d" " -f1,2 | grep $i | wc -l` -eq 0 ]
1114                                 then  
1115                                         Patches/${PLATFORM}/${PATCHES}/installpatch `pwd`/Patches/${PLATFORM}/${i} 2>&1 > /dev/null
1116                                         echo "INSTALLED PATCH ${i} "
1117                                 fi
1118                         fi
1119                 done 
1120                 ;;
1121                 *)
1122                 ;;
1123 esac
1124
1125 }
1126
1127 # ********************************************************************
1128 #
1129 #       Install Developer Cluster Patches     
1130 #
1131 # ********************************************************************
1132
1133 function DevPatch
1134 {
1135 case "X$(uname -r)" in
1136                 X5.4)
1137  
1138                         DEV_PATCHES_sparc=""
1139                         DEV_PATCHES_x86=""
1140  
1141                         PATCHES=DEV_PATCHES_${PLATFORM}
1142
1143                 ;;
1144                 *)
1145                 ;;
1146 esac
1147
1148 }
1149
1150 # ********************************************************************
1151 #
1152 #       Install CDE exit function     
1153 #
1154 # ********************************************************************
1155
1156 function Exit
1157 {
1158
1159         cat <<XYZZY
1160
1161 $LINE
1162
1163
1164 XYZZY
1165
1166 if [ -f $ADMIN_LOG ]
1167 then
1168
1169         cat <<XYZZY
1170
1171  
1172 Note:   A install-cde log which has error messages
1173         from the install-cde script can be found at:
1174
1175              install-cde log: $ADMIN_LOG
1176 XYZZY
1177 fi
1178 if [ -f  $PKG_LOG ]
1179 then
1180
1181         cat <<XYZZY
1182
1183  
1184 Note:   A pkgadd log which contains a complete log of all the output
1185         from the "pkgadd" utility can be found at:
1186
1187              pkgadd log: $PKG_LOG
1188 XYZZY
1189 fi
1190 if [ -f $PKG_RM_LOG ]
1191 then
1192
1193         cat <<XYZZY
1194
1195
1196 Note:   A pkgrm log which contains a complete log of all the output
1197         from the "pkgrm" utility can be found at:
1198
1199              pkgrm log: $PKG_RM_LOG 
1200 XYZZY
1201 fi
1202 if [ $INSTALL_GOOD == "YES" ]
1203 then
1204         if [ $SEND_MAIL == "YES" ]
1205         then
1206                 UNAME=`uname -a`
1207                 VERSION=`grep DtVERSION_STRING cde-developer/SUNWdtinc/reloc/dt/share/include/Dt/Dt.h | awk -F\" '{print $2}'`
1208                 SUBJECT=${VERSION}:${UNAME}
1209                 if [ -x /usr/dist/exe/whatami ]
1210                 then 
1211                           /usr/dist/exe/whatami 2>&1 > /tmp/tmp.whatami.$$
1212                 else
1213                         echo "NO /usr/dist/exe/whatami AVAILABLE" > /tmp/tmp.whatami.$$
1214                 fi
1215
1216                 ( cd /tmp; mailx  -s " $SUBJECT " -F cdeinstall@cde-www.Eng.Sun.COM /dev/null  < /tmp/tmp.whatami.$$ 2>&1 > /dev/null )
1217         fi
1218
1219
1220         cat <<XYZZY
1221
1222
1223 Note:   CDE has been installed on this system, please reboot this 
1224         machine before starting CDE
1225
1226 XYZZY
1227 fi
1228
1229         cat <<XYZZY
1230
1231 The install-cde script has completed.
1232 $LINE
1233
1234
1235 XYZZY
1236
1237
1238 exit $EXIT_STATUS
1239 }
1240
1241 # ********************************************************************
1242 #
1243 #       Link to packages.
1244 #
1245 # ********************************************************************
1246
1247 function LinkFunc
1248 {
1249
1250 if [ -d dt ]
1251 then 
1252         if [ -d /usr/dt ]
1253         then
1254            /bin/mv /usr/dt /usr/dt.pre-install-cde.${DATE}
1255         fi
1256
1257         ln -s `pwd`/dt /usr/dt
1258 else
1259
1260          clear
1261          cat <<XYZZY
1262 $LINE
1263  
1264  Error: We could not find the dt directory, are you sure you
1265         are running install-cde from the correct directory. 
1266
1267  
1268                 Press <Enter> to exit..
1269  
1270 $LINE
1271  
1272 XYZZY
1273           read
1274           echo "Error: $DATE: Could not find a dt directory to link to."  >> $ADMIN_LOG
1275           EXIT_STATUS=1
1276           Exit
1277
1278 fi
1279
1280 }
1281
1282 # ****************************************************************************
1283 # *
1284 # *     Determine if it is ok to remove SUNWtltk on 2.4
1285 # *
1286 # ***************************************************************************
1287
1288 function Tooltalk_min
1289 {
1290
1291
1292 case "X$(uname -r)" in
1293                 X5.4)
1294                         
1295                         if [ $CLEAN == "YES" ]; then
1296
1297                                 TTPKG_LIST=`pkginfo | grep SUNWtltk | grep -v SUNWtltkd | grep -v SUNWtltkm | awk '{print $2 }'`
1298                                 for i in $TTPKG_LIST
1299                                 do
1300                                         FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
1301                                         if [ $FOUNDPKG -ne 0 ]; then
1302                                                 if [ $VERT == "YES" ]; then
1303                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
1304                                                 else
1305                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
1306                                                 fi
1307                                                 
1308                                         fi
1309                                 done
1310
1311                         fi
1312
1313                         if [ $REMOVE_TT_ONLY == "NO" ] ; then
1314
1315                                 if [ $VERT == "YES" ] ; then
1316                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltk 2>&1 | tee -a $PKG_LOG
1317                                 else
1318                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltk 2>&1 | tee -a $PKG_LOG | grep SUNWtltk
1319                                 fi
1320                         fi
1321
1322
1323                 ;;
1324  
1325                 *)
1326                 ;;
1327 esac
1328  
1329
1330 }
1331
1332 # ****************************************************************************
1333 # *
1334 # *     Determine if it is ok to remove SUNWtltkm, SUNWtltkd on 2.4
1335 # *
1336 # ***************************************************************************
1337
1338 function Tooltalk_dev
1339 {
1340
1341
1342 case "X$(uname -r)" in
1343                 X5.4)
1344
1345
1346                         if [ $CLEAN == "YES" ]; then
1347
1348                                 TTPKG_LIST=`pkginfo | grep SUNWtltkd | awk '{print $2 }'`
1349                                 for i in $TTPKG_LIST
1350                                 do
1351                                         FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
1352                                         if [ $FOUNDPKG -ne 0 ]; then
1353                                                 if [ $VERT == "YES" ]; then
1354                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
1355                                                 else
1356                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
1357                                                 fi
1358                                         fi
1359                                 done
1360
1361                         fi
1362
1363                         if [ $REMOVE_TT_ONLY == "NO" ] ; then
1364
1365                                 if [ $VERT == "YES" ] ; then
1366                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkd 2>&1 | tee -a $PKG_LOG
1367                                 else
1368                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkd 2>&1 | tee -a $PKG_LOG | grep SUNWtltkd
1369                                 fi
1370                         fi
1371
1372                         if [ $CLEAN == "YES" ]; then
1373
1374                                 TTPKG_LIST=`pkginfo | grep SUNWtltkm | awk '{print $2 }'`
1375                                 for i in $TTPKG_LIST
1376                                 do
1377                                         FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
1378                                         if [ $FOUNDPKG -ne 0 ]; then
1379                                                 if [ $VERT == "YES" ]; then
1380                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
1381                                                 else
1382                                                         /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
1383                                                 fi
1384                                         fi
1385                                 done
1386                         fi
1387
1388                         if [ $REMOVE_TT_ONLY == "NO" ] ; then
1389
1390                                         
1391                                 if [ $VERT == "YES" ] ; then
1392                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkm 2>&1 | tee -a $PKG_LOG
1393                                 else
1394                                         /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkm 2>&1 | tee -a $PKG_LOG | grep SUNWtltkm
1395                                 fi
1396                         fi
1397                 ;;
1398  
1399                 *)
1400                 ;;
1401 esac
1402  
1403
1404 }
1405
1406
1407 # ********************************************************************
1408 #
1409 #       Load Package Strings.
1410 #       LOAD
1411 #
1412 # ********************************************************************
1413 function LoadStrings
1414 {
1415 $DEBUG
1416 case "X$(uname -r)" in
1417                 X5.4)
1418
1419                 DEV_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWmfdm SUNWdthed SUNWdtab SUNWdtdem SUNWmfman"
1420                 END_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim" 
1421                 MIN_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn SUNWdtdte SUNWmfrun"
1422
1423                 DEV_RM_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWmfdm SUNWmfdem SUNWdthed SUNWdtab SUNWdtdem SUNWmfman"
1424                 END_RM_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim" 
1425                 MIN_RM_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn SUNWdtdte SUNWmfrun"
1426
1427                 ;;
1428                 X5.5)
1429
1430                 SUNWdtcor=
1431
1432                 if [ ! -h /usr/dt/lib/libtt.so  ]; then  if [ ! -f /usr/dt/lib/libtt.so ]; then
1433         
1434                         SUNWdtcor=SUNWdtcor
1435
1436                         fi
1437                 fi
1438
1439                 /bin/pkginfo -q SUNWtltk.*
1440                 FOUNDPKG=$?
1441                 if [ $FOUNDPKG -ne 0 ]; then
1442                         SUNWtltk=SUNWtltk
1443                         SUNWtltkm=SUNWtltkm
1444                         SUNWtltkd=SUNWtltkd
1445                 else
1446                         SUNWtltk=
1447                         SUNWtltkm=
1448                         SUNWtltkd=
1449                 fi
1450  
1451                 DEV_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWdthed  SUNWdtab SUNWdtdem ${SUNWtltkm} ${SUNWtltkd}"
1452                 END_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim" 
1453                 MIN_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn ${SUNWdtcor} SUNWdtdte SUNWmfrun ${SUNWtltk}"
1454
1455                 DEV_RM_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWdthed  SUNWdtab SUNWdtdem ${SUNWtltkm} ${SUNWtltkd}"
1456                 END_RM_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim"
1457                 MIN_RM_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn  ${SUNWtltk} SUNWdtdte SUNWmfrun"
1458                 ;;
1459                 *)
1460                 clear
1461                 cat <<XYZZY
1462 $LINE
1463  
1464  Error: CDE 1.0 is only supported on SunOS 5.4 and 5.5
1465  
1466  
1467                 Press <Enter> to exit..
1468  
1469 $LINE
1470  
1471 XYZZY
1472                 read
1473                 echo "Error: $DATE: Wrong OS version, uname -r did not return 5.4 or 5.5" >> $ADMIN_LOG
1474                 EXIT_STATUS=1
1475                 Exit
1476                 ;;
1477 esac
1478 }
1479
1480
1481 # ********************************************************************
1482 #
1483 #       Check to be sure user is root
1484 #
1485 # ********************************************************************
1486
1487         USER=`/bin/id | grep root | wc -l`
1488         if [ $USER -eq 0 ]
1489         then
1490
1491                 echo ""
1492                 echo "You must be root to run this script"
1493                 echo ""
1494                 exit 1
1495         fi
1496
1497
1498
1499
1500 # ********************************************************************
1501 #
1502 #       Variable Initialization
1503 #       VARS
1504 #
1505 # ********************************************************************
1506         trap 'rm -f /tmp/admin.$$; rm -f tmp.whatami.$$;  rm -f /usr/dt/tmp.install.file.$$;  exit' INT QUIT TERM EXIT
1507         TOP=`pwd`
1508         CHECK=YES
1509         CDE_CHECK=YES
1510         EXIT_STATUS=0
1511         VERT="NO"
1512         NEW_VERT=
1513         DEBUG=
1514         CLEAN=YES
1515         NEW_CLEAN=
1516         PATCH=YES
1517         DTLOGIN=YES
1518         SDTHOME=/usr/dt
1519         SUNWtltk=
1520         SUNWtltkm=
1521         SUNWtltkd=
1522         NEW_SDTHOME=
1523         MIN=
1524         END=
1525         DEV=
1526         INSTALL_GOOD="NO"
1527         SEND_MAIL="YES"
1528         REMOVE_TT_ONLY="NO"
1529         PLATFORM=`uname -p`
1530         if [ $PLATFORM == "i386" ] 
1531         then
1532                 PLATFORM="x86"
1533         fi      
1534         RELEASE=`uname -r`
1535         DATE=`date '+%d%b%y-%H:%M:%S'`
1536         PATH=/bin:/usr/bin:/etc:/usr/bin
1537         ADMIN_LOG=/usr/tmp/SunSoft_CDE1.0_install.log.${DATE}
1538         PKG_RM_LOG=/usr/tmp/SunSoft_CDE1.0_pkgrm.log.${DATE}
1539         PKG_LOG=/usr/tmp/SunSoft_CDE1.0_pkgadd.log.${DATE}
1540         VERBOSE="-n -a /tmp/admin.$$"
1541         MENU_SELECT=NO
1542         DONE=NO
1543         LINE="____________________________________________________________________________"
1544
1545         cat >/tmp/admin.$$ <<EOF
1546 basedir=default
1547 mail=
1548 runlevel=quit
1549 conflict=nocheck
1550 setuid=nocheck
1551 action=nocheck
1552 partial=nocheck
1553 instance=unique
1554 idepend=nocheck
1555 rdepend=nocheck
1556 space=quit
1557 EOF
1558
1559
1560 # ********************************************************************
1561 #
1562 #       Argument Processing
1563 # ARGS
1564 #
1565 # ********************************************************************
1566
1567         if [ $# -gt 14 ]
1568         then
1569                 HELP $1      # exit on error
1570         fi
1571
1572         while [ $# -gt 0 ]
1573            do case $1 in
1574                 -loc)  SDTHOME=$2;                      shift 2 ;; # install location for /usr/dt
1575                 -link)  LINKDIR=$2 ; LinkFunc ;         exit    ;; 
1576                 -noclean) CLEAN="NO";                   shift   ;;
1577                 -nospace) CHECK="NO";                   shift   ;;
1578                 -nocheck) CDE_CHECK="NO";               shift   ;;
1579                 -nopatches) PATCH="NO";                 shift   ;;
1580                 -nologin) DTLOGIN="NO";                 shift   ;;
1581                 -debug) DEBUG="set -xv";                shift   ;;
1582                 -remove) LoadStrings; RemoveCDE;        exit    ;;
1583                 -help) HELP;                            exit    ;;
1584                 ?) HELP;                                exit    ;;
1585                 -ver)  VERT="YES"; VERBOSE="";          shift   ;;
1586                 -min)  MENU_SELECT="YES"; response="1"; shift   ;;
1587                 -end)  MENU_SELECT="YES"; response="2"; shift   ;;
1588                 -dev)  MENU_SELECT="YES"; response="3"; shift   ;;
1589                 *) HELP $1;                             shift   ;; # exit on error
1590            esac
1591         done
1592
1593
1594 # ********************************************************************
1595 #
1596 #       Place the selection Menu on the screen                     
1597 #
1598 # ********************************************************************
1599
1600 LoadStrings
1601
1602 while [ $DONE = "NO" ]
1603 do
1604 while [ $MENU_SELECT = "NO" ]
1605 do
1606  
1607 clear
1608
1609 cat <<XYZZY
1610 $LINE
1611
1612
1613                 Solaris Common Desktop Environment
1614                         Installation Script
1615                              Beta 1.0
1616
1617 $LINE
1618
1619
1620         1.  Minimum Installation 
1621
1622
1623         2.  CDE End User
1624
1625
1626         3.  Developer & End User
1627
1628
1629         4.  Set Install Options           
1630
1631              Install Location:          [ $SDTHOME ]
1632              Remove Old CDE Packages:   [ $CLEAN        ]
1633              Interactive Installation:  [ $VERT         ]
1634              Solaris Desktop Login 
1635                     at System Boot:     [ $DTLOGIN      ]
1636                         
1637         0.  Cancel Installation 
1638
1639 $LINE
1640
1641
1642 XYZZY
1643 print -n "\tSELECT A NUMBER [2] "
1644
1645 read response
1646 if [[ $response = `` ]] then response="2";  fi
1647  
1648 print ""
1649 print -n "\tYou have selected \"$response\", is this Correct ? (Y/N) [Y]"
1650  
1651 read abort_chance
1652 if [[ $abort_chance = "Y"  ||  $abort_chance = "y" ]] then
1653         MENU_SELECT=YES
1654 fi
1655 if [[ $abort_chance = `` ]] then MENU_SELECT=YES;  fi
1656
1657 clear
1658
1659 done
1660  
1661 if [[ $MENU_SELECT = YES ]] then
1662
1663
1664 case $response in
1665  
1666         "1" )
1667         SIZE=17000
1668         MIN="YES"
1669         if [ $CHECK == "YES" ]  ; then CheckDisk        ; else DONE=YES;  fi
1670         if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES;  fi
1671         if [ $DONE = "YES" ]    ; then InstallMin       ;       fi
1672         if [ $PATCH = "YES" ]   ; then MinPatch         ; else DONE=YES;        fi
1673         if [ $DTLOGIN = "YES" ] ; then RunDtconfig      ; else DONE=YES;        fi
1674         ;;
1675
1676         "2" )
1677         SIZE=35000
1678         MIN="YES"
1679         END="YES"
1680         if [ $CHECK == "YES" ]  ; then CheckDisk        ; else DONE=YES;  fi
1681         if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES;  fi
1682         if [ $DONE = "YES" ]    ; then InstallMin       ;       fi
1683         if [ $DONE = "YES" ]    ; then InstallEnd       ;       fi
1684         if [ $PATCH = "YES" ]   ; then MinPatch         ; else DONE=YES;        fi
1685         if [ $PATCH = "YES" ]   ; then EndPatch         ; else DONE=YES;        fi
1686         if [ $DTLOGIN = "YES" ] ; then RunDtconfig      ; else DONE=YES;        fi
1687         ;;
1688
1689         "3" )
1690         SIZE=60000
1691         MIN="YES"
1692         END="YES"
1693         DEV="YES"
1694         if [ $CHECK == "YES" ]  ; then CheckDisk        ; else DONE=YES;  fi
1695         if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES;  fi
1696         if [ $DONE = "YES" ]    ; then InstallMin       ;       fi
1697         if [ $DONE = "YES" ]    ; then InstallEnd       ;       fi
1698         if [ $DONE = "YES" ]    ; then InstallDev       ;       fi
1699         if [ $PATCH = "YES" ]   ; then MinPatch         ; else DONE=YES;        fi
1700         if [ $PATCH = "YES" ]   ; then EndPatch         ; else DONE=YES;        fi
1701         if [ $PATCH = "YES" ]   ; then DevPatch         ; else DONE=YES;        fi
1702         if [ $DTLOGIN = "YES" ] ; then RunDtconfig      ; else DONE=YES;        fi
1703         ;;
1704
1705         "4" )
1706         SetOptions
1707         MENU_SELECT=NO
1708         ;;
1709
1710         "0" )
1711         DONE="YES"
1712         ;;
1713
1714         *)
1715         print ""
1716         print ""
1717         print "\t\tI don't recogize..\"$response\" Sorry.. "
1718         sleep 2
1719         MENU_SELECT=NO
1720         ;;
1721  
1722 esac
1723 fi
1724
1725 done 
1726 Exit 
1727
1728
1729
1730
1731 # ********************************************************************
1732 #
1733 #       The End
1734 #
1735 ********************************************************************
1736