install-cde 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730
  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. fi
  333. pkglist="${DEV_PKGS} ${SUNWmfman} ${SUNWmfdm}"
  334. cd cde-developer
  335. AddPkgs
  336. Tooltalk_dev
  337. cd $TOP
  338. else
  339. DONE=NO
  340. MENU_SELECT=NO
  341. clear
  342. cat <<XYZZY
  343. $LINE
  344. Error: Can't find the cde-developer package directory located on
  345. the CDE cdrom. Be sure you execute this script
  346. in the top directory of your CDE cdrom, where the
  347. directories: cde-min, cde-end-user, cde-developer and
  348. patches should be available.
  349. Exit this install script and restart it from the correct
  350. location.
  351. Press <Enter> to exit..
  352. $LINE
  353. XYZZY
  354. read
  355. echo "Error: $DATE: Can not find the cde-developer directory, to load end-usr packages" >> $ADMIN_LOG
  356. EXIT_STATUS=1
  357. Exit
  358. fi
  359. }
  360. # ********************************************************************
  361. #
  362. # Function which adds packages
  363. # REMOVE
  364. #
  365. # ********************************************************************
  366. function RemoveCDE
  367. {
  368. $DEBUG
  369. REMOVE_TT_ONLY="YES"
  370. clear
  371. cat <<XYZZY
  372. $LINE
  373. Warning: This remove program will remove all the CDE packages from
  374. your system.
  375. $LINE
  376. XYZZY
  377. print -n "\tDo you wish to continue [Y]"
  378. read response
  379. if [[ $response = `` ]] then response="Y"; fi
  380. if [[ $response = "Y" || $response = "y" ]] then
  381. echo
  382. else
  383. Exit
  384. fi
  385. pkglist="${MIN_RM_PKGS} ${END_RM_PKGS} ${DEV_RM_PKGS}"
  386. clear
  387. if [ -f /usr/dt/bin/dtconfig ]
  388. then
  389. /usr/dt/bin/dtconfig -e 2>&1 > /dev/null
  390. fi
  391. echo "Starting to Remove Packages..."
  392. Tooltalk_min
  393. Tooltalk_dev
  394. for pkg in $pkglist
  395. do
  396. /bin/pkginfo -q ${pkg}.*
  397. FOUNDPKG=$?
  398. if [ $FOUNDPKG -eq 0 ]; then
  399. if [ $VERT == "YES" ]; then
  400. /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG
  401. else
  402. /usr/sbin/pkgrm $VERBOSE ${pkg}.* 2>&1 | tee -a $PKG_RM_LOG | grep $pkg
  403. fi
  404. fi
  405. done
  406. Exit
  407. }
  408. # ********************************************************************
  409. #
  410. # Function which adds packages
  411. # PKGS
  412. #
  413. # ********************************************************************
  414. function AddPkgs
  415. {
  416. $DEBUG
  417. if [ $COPYRIGHT_FIRST_TIME == "YES" ]; then
  418. echo "Starting Install ....."
  419. fi
  420. for pkg in $pkglist
  421. do
  422. if [ $COPYRIGHT_FIRST_TIME == "YES" ]; then
  423. /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG
  424. if [ $? -ne 0 ] ; then
  425. echo $ERROR_LINE
  426. echo $ERROR_LINE >> $ADMIN_LOG
  427. fi
  428. COPYRIGHT_FIRST_TIME="NO"
  429. else if [ "$COPYRIGHT_FIRST_TIME" == "NO" ] ; then
  430. if [ $VERT == "YES" ] ; then
  431. /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG
  432. else
  433. /usr/sbin/pkgadd $VERBOSE -d `pwd` $pkg 2>&1 | tee -a $PKG_LOG | grep $pkg
  434. fi
  435. fi
  436. fi
  437. done
  438. }
  439. # ********************************************************************
  440. #
  441. # Function which sets install options
  442. #
  443. # ********************************************************************
  444. function SetOptions
  445. {
  446. clear
  447. cat <<XYZZY
  448. $LINE
  449. 4. Set Install Options [ Current ] [ New ]
  450. XYZZY
  451. print -n " Install Location: [ $SDTHOME ] [ ]\b\b"
  452. read NEW_SDTHOME
  453. if [ "${NEW_SDTHOME}" == "" ]
  454. then
  455. NEW_SDTHOME="/usr/dt"
  456. fi
  457. firstchar=`echo $NEW_SDTHOME | cut -c1`
  458. if [ "$firstchar" != "/" ]
  459. then
  460. echo ""
  461. echo ""
  462. echo "\tError: \t $NEW_SDTHOME is not an absolute path, please try again "
  463. echo ""
  464. echo ""
  465. echo "\t\tPress <Enter> to continue...."
  466. read
  467. return
  468. fi
  469. SDTHOME=$NEW_SDTHOME
  470. print -n " Remove Old CDE Packages: [ $CLEAN ] [ ]\b\b"
  471. read NEW_CLEAN
  472. if [ "${NEW_CLEAN}" != "YES" ] ; then if [ "${NEW_CLEAN}" != "NO" ] ; then if [ "${NEW_CLEAN}" != "" ]
  473. then
  474. echo ""
  475. echo ""
  476. echo "\tError: \t You must answer YES or NO , please try again "
  477. echo ""
  478. echo ""
  479. echo "\t\tPress <Enter> to continue...."
  480. read
  481. return
  482. fi
  483. fi
  484. fi
  485. if [ "$NEW_CLEAN" == "" ]
  486. then
  487. CLEAN=YES
  488. else
  489. CLEAN=$NEW_CLEAN
  490. fi
  491. print -n " Interactive Installation [ $VERT ] [ ]\b\b"
  492. read NEW_VERT
  493. if [ "${NEW_VERT}" != "YES" ] ; then if [ "${NEW_VERT}" != "NO" ] ; then if [ "${NEW_VERT}" != "" ]
  494. then
  495. echo ""
  496. echo ""
  497. echo "\tError: \t You must answer YES or NO , please try again "
  498. echo ""
  499. echo ""
  500. echo "\t\tPress <Enter> to continue...."
  501. read
  502. return
  503. fi
  504. fi
  505. fi
  506. if [ "${NEW_VERT}" == "" ]
  507. then
  508. VERT=NO
  509. VERBOSE="-n -a /tmp/admin.$$"
  510. else
  511. VERT=$NEW_VERT
  512. if [ $VERT == "YES" ]; then VERBOSE="" ; fi
  513. if [ $VERT == "NO" ]; then VERBOSE="-n -a /tmp/admin.$$" ; fi
  514. fi
  515. print " Solaris Desktop Login "
  516. print -n " at System Boot: [ $DTLOGIN ] [ ]\b\b"
  517. read NEW_DTLOGIN
  518. if [ "${NEW_DTLOGIN}" != "YES" ] ; then if [ "${NEW_DTLOGIN}" != "NO" ] ; then if [ "${NEW_DTLOGIN}" != "" ]
  519. then
  520. echo ""
  521. echo ""
  522. echo "\tError: \t You must answer YES or NO , please try again "
  523. echo ""
  524. echo ""
  525. echo "\t\tPress <Enter> to continue...."
  526. read
  527. return
  528. fi
  529. fi
  530. fi
  531. if [ "$NEW_DTLOGIN" == "" ]
  532. then
  533. DTLOGIN=YES
  534. else
  535. DTLOGIN=$NEW_DTLOGIN
  536. fi
  537. }
  538. # ********************************************************************
  539. #
  540. # Function which creates the new install location link
  541. #
  542. # ********************************************************************
  543. function CreateTheLink
  544. {
  545. $DEBUG
  546. clear
  547. if [ -d /usr/dt ]
  548. then
  549. if [ "`uname -r`" == "5.5" ]
  550. then
  551. S_R="SUNWdtcor SUNWmfrun SUNWmfman SUNWmfdm"
  552. for i in $S_R
  553. do
  554. echo "Cleaning up Solaris 2.5 $i package from /usr/dt ..."
  555. if [ $VERT == "YES" ]; then
  556. /usr/sbin/pkgrm $VERBOSE ${i}.* 2>&1 | tee -a $PKG_RM_LOG | grep -v no
  557. else
  558. /usr/sbin/pkgrm $VERBOSE ${i}.* 2>&1 | tee -a $PKG_RM_LOG | grep $i | grep -v no
  559. fi
  560. done
  561. fi
  562. if [ -d /usr/dt ]
  563. then
  564. find /usr/dt -depth -exec /bin/rmdir {} 2>&1 > /dev/null \; 2>&1 > /dev/null
  565. fi
  566. fi
  567. /usr/bin/rm /usr/dt 2>&1 > /dev/null
  568. if [ -d /usr/dt ]
  569. then
  570. clear
  571. cat <<XYZZY
  572. $LINE
  573. Warning: A "/usr/dt" directory still exists on this machine, this
  574. prohibits a needed link from being setup from
  575. /usr/dt to $SDTHOME
  576. This installation can move the current /usr/dt to
  577. /usr/dt.pre.CDE.${DATE}
  578. and proceed with the installation.
  579. Do you want to move your current /usr/dt
  580. $LINE
  581. XYZZY
  582. print -n "\tMove existing /usr/dt directory [Y]"
  583. read response
  584. if [[ $response = `` ]] then response="Y"; fi
  585. if [[ $response = "Y" || $response = "y" ]]
  586. then
  587. mv /usr/dt /usr/dt.pre.CDE.${DATE}
  588. mkdir -p ${SDTHOME}
  589. if [ $? -ne 0 ]
  590. then
  591. clear
  592. cat <<XYZZY
  593. $LINE
  594. Error: Could not create $SDTHOME directory. Please verify that
  595. you have root permission on the file system located
  596. at $SDTHOME
  597. Hint: You most likely have an existing /usr/dt link which points to
  598. a remote server. If you don't have root permission on
  599. this server, you need to manually remove the this link
  600. before running install-cde again.
  601. Press <Enter> to exit..
  602. $LINE
  603. XYZZY
  604. EXIT_STATUS=1
  605. Exit
  606. fi
  607. ln -s ${SDTHOME} /usr/dt
  608. if [ $? -ne 0 ]
  609. then
  610. clear
  611. cat <<XYZZY
  612. $LINE
  613. Error: Could not create alternate link from /usr/dt to $SDTHOME ,
  614. please verfy you have root permission on the file systems
  615. in question.
  616. Hint: You most likely have an existing /usr/dt link which points to
  617. a remote server. If you don't have root permission on
  618. this server, you need to manually remove the this link
  619. before running install-cde again.
  620. Press <Enter> to exit..
  621. $LINE
  622. XYZZY
  623. read
  624. echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
  625. EXIT_STATUS=1
  626. Exit
  627. fi
  628. else
  629. DONE=NO
  630. MENU_SELECT=NO
  631. EXIT_STATUS=1
  632. Exit
  633. fi
  634. fi
  635. if [ -f /usr/dt ]
  636. then
  637. clear
  638. cat <<XYZZY
  639. $LINE
  640. Warning: A "/usr/dt" file still exists on this machine, this
  641. prohibits a needed link from being setup from
  642. /usr/dt to $SDTHOME
  643. This installation can move the current /usr/dt to
  644. /usr/dt.pre.CDE.${DATE}
  645. and proceed with the installation.
  646. Do you want to move your current /usr/dt
  647. $LINE
  648. XYZZY
  649. print -n "\tMove existing /usr/dt file [Y]"
  650. read response
  651. if [[ $response = `` ]] then response="Y"; fi
  652. if [[ $response = "Y" || $response = "y" ]]
  653. then
  654. mv /usr/dt /usr/dt.pre.CDE.${DATE}
  655. mkdir -p ${SDTHOME}
  656. if [ $? -ne 0 ]
  657. then
  658. clear
  659. cat <<XYZZY
  660. $LINE
  661. Error: Could not create $SDTHOME directory. Please verify you have
  662. you have root permission on the file systems in question.
  663. Hint: You most likely have an existing /usr/dt link which points to
  664. a remote server. If you don't have root permission on
  665. this server, you need to manually remove the this link
  666. before running install-cde again.
  667. Press <Enter> to exit..
  668. $LINE
  669. XYZZY
  670. EXIT_STATUS=1
  671. Exit
  672. fi
  673. ln -s ${SDTHOME} /usr/dt
  674. if [ $? -ne 0 ]
  675. then
  676. clear
  677. cat <<XYZZY
  678. $LINE
  679. Error: Could not create alternate link from /usr/dt to $SDTHOME ,
  680. please verfy you have root permission on the file systems
  681. in question.
  682. Hint: You most likely have an existing /usr/dt link which points to
  683. a remote server. If you don't have root permission on
  684. this server, you need to manually remove the this link
  685. before running install-cde again.
  686. Press <Enter> to exit..
  687. $LINE
  688. XYZZY
  689. read
  690. echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link faile
  691. d" >> $ADMIN_LOG
  692. EXIT_STATUS=1
  693. Exit
  694. fi
  695. else
  696. DONE=NO
  697. MENU_SELECT=NO
  698. EXIT_STATUS=1
  699. Exit
  700. fi
  701. fi
  702. mkdir -p ${SDTHOME}
  703. ln -s ${SDTHOME} /usr/dt
  704. if [ $? -ne 0 ]
  705. then
  706. clear
  707. cat <<XYZZY
  708. $LINE
  709. Error: Could not create alternate link from /usr/dt to $SDTHOME ,
  710. please verfy you have root permission on the file systems
  711. in question.
  712. Hint: You most likely have an existing /usr/dt link which points to
  713. a remote server. If you don't have root permission on
  714. this server, you need to manually remove the this link
  715. before running install-cde again.
  716. Press <Enter> to exit..
  717. $LINE
  718. XYZZY
  719. read
  720. echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
  721. Exit
  722. fi
  723. touch /usr/dt/tmp.install.file.$$
  724. if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
  725. then
  726. rm /usr/dt/tmp.install.file.$$
  727. rm /usr/dt
  728. clear
  729. cat <<XYZZY
  730. $LINE
  731. Error: This machine does not appear to have root permission for
  732. the filesystem located at: $SDTHOME
  733. Hint: You most likely have an existing /usr/dt link which points to
  734. a remote server. If you don't have root permission on
  735. this server, you need to manually remove the this link
  736. before running install-cde again.
  737. Press <Enter> to exit..
  738. $LINE
  739. XYZZY
  740. read
  741. echo "Error: $DATE: The ln -s $SDTHOME command returned a none zero exit, the link failed" >> $ADMIN_LOG
  742. EXIT_STATUS=1
  743. Exit
  744. fi
  745. rm /usr/dt/tmp.install.file.$$
  746. MENU_SELECT=NO
  747. }
  748. # ********************************************************************
  749. #
  750. # Checks Root permission in /usr/dt file system
  751. #
  752. # ********************************************************************
  753. function CheckRoot
  754. {
  755. touch /usr/dt/tmp.install.file.$$
  756. if [ `ls -l /usr/dt/tmp.install.file.$$ | grep root | wc -l` -eq 0 ]
  757. then
  758. rm /usr/dt/tmp.install.file.$$
  759. clear
  760. cat <<XYZZY
  761. $LINE
  762. Error: This machine does not appear to have root permission for
  763. the filesystem located at: $SDTHOME
  764. Hint: You most likely have an existing /usr/dt link which points to
  765. a remote server. If you don't have root permission on
  766. this server, you need to manually remove the this link
  767. before running install-cde again.
  768. Press <Enter> to exit..
  769. $LINE
  770. XYZZY
  771. read
  772. echo "Error: $DATE: Can not create root permission files in $SDTHOME" >> $ADMIN_LOG
  773. EXIT_STATUS=1
  774. Exit
  775. fi
  776. rm /usr/dt/tmp.install.file.$$
  777. MENU_SELECT=NO
  778. }
  779. # ********************************************************************
  780. #
  781. # Install Min Cluster Pathces
  782. #
  783. # ********************************************************************
  784. function MinPatch
  785. {
  786. case "X$(uname -r)" in
  787. X5.4)
  788. MIN_PATCHES_sparc=""
  789. MIN_PATCHES_x86=""
  790. PATCHES=MIN_PATCHES_${PLATFORM}
  791. ;;
  792. *)
  793. ;;
  794. esac
  795. }
  796. # ********************************************************************
  797. #
  798. # Install End Cluster Patches
  799. #
  800. # ********************************************************************
  801. function EndPatch
  802. {
  803. case "X$(uname -r)" in
  804. X5.4)
  805. END_PATCHES_sparc="101925-02"
  806. END_PATCHES_x86="101926-02"
  807. if [ $PLATFORM == "sparc" ]
  808. then
  809. PATCHES=$END_PATCHES_sparc
  810. else
  811. PATCHES=$END_PATCHES_x86
  812. fi
  813. cd $TOP
  814. for i in $PATCHES
  815. do
  816. if [ -d Patches/${PLATFORM}/${i} ]
  817. then
  818. if [ `showrev -p | /usr/bin/cut -d" " -f1,2 | grep $i | wc -l` -eq 0 ]
  819. then
  820. Patches/${PLATFORM}/${PATCHES}/installpatch `pwd`/Patches/${PLATFORM}/${i} 2>&1 > /dev/null
  821. echo "INSTALLED PATCH ${i} "
  822. fi
  823. fi
  824. done
  825. ;;
  826. *)
  827. ;;
  828. esac
  829. }
  830. # ********************************************************************
  831. #
  832. # Install Developer Cluster Patches
  833. #
  834. # ********************************************************************
  835. function DevPatch
  836. {
  837. case "X$(uname -r)" in
  838. X5.4)
  839. DEV_PATCHES_sparc=""
  840. DEV_PATCHES_x86=""
  841. PATCHES=DEV_PATCHES_${PLATFORM}
  842. ;;
  843. *)
  844. ;;
  845. esac
  846. }
  847. # ********************************************************************
  848. #
  849. # Install CDE exit function
  850. #
  851. # ********************************************************************
  852. function Exit
  853. {
  854. cat <<XYZZY
  855. $LINE
  856. XYZZY
  857. if [ -f $ADMIN_LOG ]
  858. then
  859. cat <<XYZZY
  860. Note: A install-cde log which has error messages
  861. from the install-cde script can be found at:
  862. install-cde log: $ADMIN_LOG
  863. XYZZY
  864. fi
  865. if [ -f $PKG_LOG ]
  866. then
  867. cat <<XYZZY
  868. Note: A pkgadd log which contains a complete log of all the output
  869. from the "pkgadd" utility can be found at:
  870. pkgadd log: $PKG_LOG
  871. XYZZY
  872. fi
  873. if [ -f $PKG_RM_LOG ]
  874. then
  875. cat <<XYZZY
  876. Note: A pkgrm log which contains a complete log of all the output
  877. from the "pkgrm" utility can be found at:
  878. pkgrm log: $PKG_RM_LOG
  879. XYZZY
  880. fi
  881. if [ $INSTALL_GOOD == "YES" ]
  882. then
  883. if [ $SEND_MAIL == "YES" ]
  884. then
  885. UNAME=`uname -a`
  886. VERSION=`grep DtVERSION_STRING cde-developer/SUNWdtinc/reloc/dt/share/include/Dt/Dt.h | awk -F\" '{print $2}'`
  887. SUBJECT=${VERSION}:${UNAME}
  888. if [ -x /usr/dist/exe/whatami ]
  889. then
  890. /usr/dist/exe/whatami 2>&1 > /tmp/tmp.whatami.$$
  891. else
  892. echo "NO /usr/dist/exe/whatami AVAILABLE" > /tmp/tmp.whatami.$$
  893. fi
  894. ( cd /tmp; mailx -s " $SUBJECT " -F cdeinstall@cde-www.Eng.Sun.COM /dev/null < /tmp/tmp.whatami.$$ 2>&1 > /dev/null )
  895. fi
  896. cat <<XYZZY
  897. Note: CDE has been installed on this system, please reboot this
  898. machine before starting CDE
  899. XYZZY
  900. fi
  901. cat <<XYZZY
  902. The install-cde script has completed.
  903. $LINE
  904. XYZZY
  905. exit $EXIT_STATUS
  906. }
  907. # ********************************************************************
  908. #
  909. # Link to packages.
  910. #
  911. # ********************************************************************
  912. function LinkFunc
  913. {
  914. if [ -d dt ]
  915. then
  916. if [ -d /usr/dt ]
  917. then
  918. /bin/mv /usr/dt /usr/dt.pre-install-cde.${DATE}
  919. fi
  920. ln -s `pwd`/dt /usr/dt
  921. else
  922. clear
  923. cat <<XYZZY
  924. $LINE
  925. Error: We could not find the dt directory, are you sure you
  926. are running install-cde from the correct directory.
  927. Press <Enter> to exit..
  928. $LINE
  929. XYZZY
  930. read
  931. echo "Error: $DATE: Could not find a dt directory to link to." >> $ADMIN_LOG
  932. EXIT_STATUS=1
  933. Exit
  934. fi
  935. }
  936. # ****************************************************************************
  937. # *
  938. # * Determine if it is ok to remove SUNWtltk on 2.4
  939. # *
  940. # ***************************************************************************
  941. function Tooltalk_min
  942. {
  943. case "X$(uname -r)" in
  944. X5.4)
  945. if [ $CLEAN == "YES" ]; then
  946. TTPKG_LIST=`pkginfo | grep SUNWtltk | grep -v SUNWtltkd | grep -v SUNWtltkm | awk '{print $2 }'`
  947. for i in $TTPKG_LIST
  948. do
  949. FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
  950. if [ $FOUNDPKG -ne 0 ]; then
  951. if [ $VERT == "YES" ]; then
  952. /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
  953. else
  954. /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
  955. fi
  956. fi
  957. done
  958. fi
  959. if [ $REMOVE_TT_ONLY == "NO" ] ; then
  960. if [ $VERT == "YES" ] ; then
  961. /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltk 2>&1 | tee -a $PKG_LOG
  962. else
  963. /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltk 2>&1 | tee -a $PKG_LOG | grep SUNWtltk
  964. fi
  965. fi
  966. ;;
  967. *)
  968. ;;
  969. esac
  970. }
  971. # ****************************************************************************
  972. # *
  973. # * Determine if it is ok to remove SUNWtltkm, SUNWtltkd on 2.4
  974. # *
  975. # ***************************************************************************
  976. function Tooltalk_dev
  977. {
  978. case "X$(uname -r)" in
  979. X5.4)
  980. if [ $CLEAN == "YES" ]; then
  981. TTPKG_LIST=`pkginfo | grep SUNWtltkd | awk '{print $2 }'`
  982. for i in $TTPKG_LIST
  983. do
  984. FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
  985. if [ $FOUNDPKG -ne 0 ]; then
  986. if [ $VERT == "YES" ]; then
  987. /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
  988. else
  989. /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
  990. fi
  991. fi
  992. done
  993. fi
  994. if [ $REMOVE_TT_ONLY == "NO" ] ; then
  995. if [ $VERT == "YES" ] ; then
  996. /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkd 2>&1 | tee -a $PKG_LOG
  997. else
  998. /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkd 2>&1 | tee -a $PKG_LOG | grep SUNWtltkd
  999. fi
  1000. fi
  1001. if [ $CLEAN == "YES" ]; then
  1002. TTPKG_LIST=`pkginfo | grep SUNWtltkm | awk '{print $2 }'`
  1003. for i in $TTPKG_LIST
  1004. do
  1005. FOUNDPKG=`/bin/pkginfo -l $i | grep "VERSION" | grep "3.5" | wc -l`
  1006. if [ $FOUNDPKG -ne 0 ]; then
  1007. if [ $VERT == "YES" ]; then
  1008. /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG
  1009. else
  1010. /usr/sbin/pkgrm $VERBOSE $i 2>&1 | tee -a $PKG_RM_LOG | grep $i
  1011. fi
  1012. fi
  1013. done
  1014. fi
  1015. if [ $REMOVE_TT_ONLY == "NO" ] ; then
  1016. if [ $VERT == "YES" ] ; then
  1017. /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkm 2>&1 | tee -a $PKG_LOG
  1018. else
  1019. /usr/sbin/pkgadd $VERBOSE -d `pwd` SUNWtltkm 2>&1 | tee -a $PKG_LOG | grep SUNWtltkm
  1020. fi
  1021. fi
  1022. ;;
  1023. *)
  1024. ;;
  1025. esac
  1026. }
  1027. # ********************************************************************
  1028. #
  1029. # Load Package Strings.
  1030. # LOAD
  1031. #
  1032. # ********************************************************************
  1033. function LoadStrings
  1034. {
  1035. $DEBUG
  1036. case "X$(uname -r)" in
  1037. X5.4)
  1038. DEV_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWmfdm SUNWdthed SUNWdtab SUNWdtdem SUNWmfman"
  1039. END_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim"
  1040. MIN_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn SUNWdtdte SUNWmfrun"
  1041. DEV_RM_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWmfdm SUNWmfdem SUNWdthed SUNWdtab SUNWdtdem SUNWmfman"
  1042. END_RM_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim"
  1043. MIN_RM_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn SUNWdtdte SUNWmfrun"
  1044. ;;
  1045. X5.5)
  1046. SUNWdtcor=
  1047. if [ ! -h /usr/dt/lib/libtt.so ]; then if [ ! -f /usr/dt/lib/libtt.so ]; then
  1048. SUNWdtcor=SUNWdtcor
  1049. fi
  1050. fi
  1051. /bin/pkginfo -q SUNWtltk.*
  1052. FOUNDPKG=$?
  1053. if [ $FOUNDPKG -ne 0 ]; then
  1054. SUNWtltk=SUNWtltk
  1055. SUNWtltkm=SUNWtltkm
  1056. SUNWtltkd=SUNWtltkd
  1057. else
  1058. SUNWtltk=
  1059. SUNWtltkm=
  1060. SUNWtltkd=
  1061. fi
  1062. DEV_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWdthed SUNWdtab SUNWdtdem ${SUNWtltkm} ${SUNWtltkd}"
  1063. END_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim"
  1064. MIN_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn ${SUNWdtcor} SUNWdtdte SUNWmfrun ${SUNWtltk}"
  1065. DEV_RM_PKGS="SUNWdtinc SUNWdtma SUNWdtmad SUNWdthed SUNWdtab SUNWdtdem ${SUNWtltkm} ${SUNWtltkd}"
  1066. END_RM_PKGS="SUNWdtwm SUNWdthe SUNWdthev SUNWdtdst SUNWdtim"
  1067. MIN_RM_PKGS="SUNWdtft SUNWdtdmn SUNWdtbas SUNWdticn ${SUNWtltk} SUNWdtdte SUNWmfrun"
  1068. ;;
  1069. *)
  1070. clear
  1071. cat <<XYZZY
  1072. $LINE
  1073. Error: CDE 1.0 is only supported on SunOS 5.4 and 5.5
  1074. Press <Enter> to exit..
  1075. $LINE
  1076. XYZZY
  1077. read
  1078. echo "Error: $DATE: Wrong OS version, uname -r did not return 5.4 or 5.5" >> $ADMIN_LOG
  1079. EXIT_STATUS=1
  1080. Exit
  1081. ;;
  1082. esac
  1083. }
  1084. # ********************************************************************
  1085. #
  1086. # Check to be sure user is root
  1087. #
  1088. # ********************************************************************
  1089. USER=`/bin/id | grep root | wc -l`
  1090. if [ $USER -eq 0 ]
  1091. then
  1092. echo ""
  1093. echo "You must be root to run this script"
  1094. echo ""
  1095. exit 1
  1096. fi
  1097. # ********************************************************************
  1098. #
  1099. # Variable Initialization
  1100. # VARS
  1101. #
  1102. # ********************************************************************
  1103. trap 'rm -f /tmp/admin.$$; rm -f tmp.whatami.$$; rm -f /usr/dt/tmp.install.file.$$; exit' INT QUIT TERM EXIT
  1104. TOP=`pwd`
  1105. CHECK=YES
  1106. CDE_CHECK=YES
  1107. EXIT_STATUS=0
  1108. VERT="NO"
  1109. NEW_VERT=
  1110. DEBUG=
  1111. CLEAN=YES
  1112. NEW_CLEAN=
  1113. PATCH=YES
  1114. DTLOGIN=YES
  1115. SDTHOME=/usr/dt
  1116. SUNWtltk=
  1117. SUNWtltkm=
  1118. SUNWtltkd=
  1119. NEW_SDTHOME=
  1120. MIN=
  1121. END=
  1122. DEV=
  1123. INSTALL_GOOD="NO"
  1124. SEND_MAIL="YES"
  1125. REMOVE_TT_ONLY="NO"
  1126. PLATFORM=`uname -p`
  1127. if [ $PLATFORM == "i386" ]
  1128. then
  1129. PLATFORM="x86"
  1130. fi
  1131. RELEASE=`uname -r`
  1132. DATE=`date '+%d%b%y-%H:%M:%S'`
  1133. PATH=/bin:/usr/bin:/etc:/usr/bin
  1134. ADMIN_LOG=/usr/tmp/SunSoft_CDE1.0_install.log.${DATE}
  1135. PKG_RM_LOG=/usr/tmp/SunSoft_CDE1.0_pkgrm.log.${DATE}
  1136. PKG_LOG=/usr/tmp/SunSoft_CDE1.0_pkgadd.log.${DATE}
  1137. VERBOSE="-n -a /tmp/admin.$$"
  1138. MENU_SELECT=NO
  1139. DONE=NO
  1140. LINE="____________________________________________________________________________"
  1141. cat >/tmp/admin.$$ <<EOF
  1142. basedir=default
  1143. mail=
  1144. runlevel=quit
  1145. conflict=nocheck
  1146. setuid=nocheck
  1147. action=nocheck
  1148. partial=nocheck
  1149. instance=unique
  1150. idepend=nocheck
  1151. rdepend=nocheck
  1152. space=quit
  1153. EOF
  1154. # ********************************************************************
  1155. #
  1156. # Argument Processing
  1157. # ARGS
  1158. #
  1159. # ********************************************************************
  1160. if [ $# -gt 14 ]
  1161. then
  1162. HELP $1 # exit on error
  1163. fi
  1164. while [ $# -gt 0 ]
  1165. do case $1 in
  1166. -loc) SDTHOME=$2; shift 2 ;; # install location for /usr/dt
  1167. -link) LINKDIR=$2 ; LinkFunc ; exit ;;
  1168. -noclean) CLEAN="NO"; shift ;;
  1169. -nospace) CHECK="NO"; shift ;;
  1170. -nocheck) CDE_CHECK="NO"; shift ;;
  1171. -nopatches) PATCH="NO"; shift ;;
  1172. -nologin) DTLOGIN="NO"; shift ;;
  1173. -debug) DEBUG="set -xv"; shift ;;
  1174. -remove) LoadStrings; RemoveCDE; exit ;;
  1175. -help) HELP; exit ;;
  1176. ?) HELP; exit ;;
  1177. -ver) VERT="YES"; VERBOSE=""; shift ;;
  1178. -min) MENU_SELECT="YES"; response="1"; shift ;;
  1179. -end) MENU_SELECT="YES"; response="2"; shift ;;
  1180. -dev) MENU_SELECT="YES"; response="3"; shift ;;
  1181. *) HELP $1; shift ;; # exit on error
  1182. esac
  1183. done
  1184. # ********************************************************************
  1185. #
  1186. # Place the selection Menu on the screen
  1187. #
  1188. # ********************************************************************
  1189. LoadStrings
  1190. while [ $DONE = "NO" ]
  1191. do
  1192. while [ $MENU_SELECT = "NO" ]
  1193. do
  1194. clear
  1195. cat <<XYZZY
  1196. $LINE
  1197. Solaris Common Desktop Environment
  1198. Installation Script
  1199. Beta 1.0
  1200. $LINE
  1201. 1. Minimum Installation
  1202. 2. CDE End User
  1203. 3. Developer & End User
  1204. 4. Set Install Options
  1205. Install Location: [ $SDTHOME ]
  1206. Remove Old CDE Packages: [ $CLEAN ]
  1207. Interactive Installation: [ $VERT ]
  1208. Solaris Desktop Login
  1209. at System Boot: [ $DTLOGIN ]
  1210. 0. Cancel Installation
  1211. $LINE
  1212. XYZZY
  1213. print -n "\tSELECT A NUMBER [2] "
  1214. read response
  1215. if [[ $response = `` ]] then response="2"; fi
  1216. print ""
  1217. print -n "\tYou have selected \"$response\", is this Correct ? (Y/N) [Y]"
  1218. read abort_chance
  1219. if [[ $abort_chance = "Y" || $abort_chance = "y" ]] then
  1220. MENU_SELECT=YES
  1221. fi
  1222. if [[ $abort_chance = `` ]] then MENU_SELECT=YES; fi
  1223. clear
  1224. done
  1225. if [[ $MENU_SELECT = YES ]] then
  1226. case $response in
  1227. "1" )
  1228. SIZE=17000
  1229. MIN="YES"
  1230. if [ $CHECK == "YES" ] ; then CheckDisk ; else DONE=YES; fi
  1231. if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES; fi
  1232. if [ $DONE = "YES" ] ; then InstallMin ; fi
  1233. if [ $PATCH = "YES" ] ; then MinPatch ; else DONE=YES; fi
  1234. if [ $DTLOGIN = "YES" ] ; then RunDtconfig ; else DONE=YES; fi
  1235. ;;
  1236. "2" )
  1237. SIZE=35000
  1238. MIN="YES"
  1239. END="YES"
  1240. if [ $CHECK == "YES" ] ; then CheckDisk ; else DONE=YES; fi
  1241. if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES; fi
  1242. if [ $DONE = "YES" ] ; then InstallMin ; fi
  1243. if [ $DONE = "YES" ] ; then InstallEnd ; fi
  1244. if [ $PATCH = "YES" ] ; then MinPatch ; else DONE=YES; fi
  1245. if [ $PATCH = "YES" ] ; then EndPatch ; else DONE=YES; fi
  1246. if [ $DTLOGIN = "YES" ] ; then RunDtconfig ; else DONE=YES; fi
  1247. ;;
  1248. "3" )
  1249. SIZE=60000
  1250. MIN="YES"
  1251. END="YES"
  1252. DEV="YES"
  1253. if [ $CHECK == "YES" ] ; then CheckDisk ; else DONE=YES; fi
  1254. if [ $SDTHOME != "/usr/dt" ] ; then CreateTheLink ; else DONE=YES; fi
  1255. if [ $DONE = "YES" ] ; then InstallMin ; fi
  1256. if [ $DONE = "YES" ] ; then InstallEnd ; fi
  1257. if [ $DONE = "YES" ] ; then InstallDev ; fi
  1258. if [ $PATCH = "YES" ] ; then MinPatch ; else DONE=YES; fi
  1259. if [ $PATCH = "YES" ] ; then EndPatch ; else DONE=YES; fi
  1260. if [ $PATCH = "YES" ] ; then DevPatch ; else DONE=YES; fi
  1261. if [ $DTLOGIN = "YES" ] ; then RunDtconfig ; else DONE=YES; fi
  1262. ;;
  1263. "4" )
  1264. SetOptions
  1265. MENU_SELECT=NO
  1266. ;;
  1267. "0" )
  1268. DONE="YES"
  1269. ;;
  1270. *)
  1271. print ""
  1272. print ""
  1273. print "\t\tI don't recogize..\"$response\" Sorry.. "
  1274. sleep 2
  1275. MENU_SELECT=NO
  1276. ;;
  1277. esac
  1278. fi
  1279. done
  1280. Exit
  1281. # ********************************************************************
  1282. #
  1283. # The End
  1284. #
  1285. ********************************************************************