install-cde 38 KB

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