dinstall.dt.src 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. XCOMM!/bin/ksh
  2. XCOMM $XConsortium: dinstall.dt.src /main/6 1996/04/23 11:18:22 drk $
  3. XCOMM ==========================================================================
  4. XCOMM ==========================================================================
  5. XCOMM deinstall.dt
  6. XCOMM
  7. XCOMM Script to deinstall the April 1994 Snapshot Desktop on
  8. XCOMM HP, IBM, Sun, Fujitsu, or Novell Unix systems from a CDROM
  9. XCOMM
  10. XCOMM ==========================================================================
  11. XCOMM ==========================================================================
  12. XCOMM ==========================================================================
  13. XCOMM
  14. XCOMM DtiClearScreen - clears the screen
  15. XCOMM
  16. XCOMM Input - none
  17. XCOMM Output - none
  18. XCOMM Return -none
  19. XCOMM ==========================================================================
  20. #define HASH #
  21. #define STAR *
  22. DtiClearScreen() {
  23. clear 1>&2
  24. HASH DtiPrint "clear"
  25. }
  26. XCOMM ==========================================================================
  27. XCOMM
  28. XCOMM Log - echo to log
  29. XCOMM
  30. XCOMM Input
  31. XCOMM $1 - data to echo to log
  32. XCOMM Output - none
  33. XCOMM Return -none
  34. XCOMM ==========================================================================
  35. Log()
  36. {
  37. printf "$1" $2 $3 $4 $5 >> $LOG_FILE
  38. }
  39. XCOMM ==========================================================================
  40. XCOMM
  41. XCOMM DtiPrint - echo to stderr and log
  42. XCOMM
  43. XCOMM Input
  44. XCOMM $1 - data to echo to stdout
  45. XCOMM Output - none
  46. XCOMM Return -none
  47. XCOMM ==========================================================================
  48. DtiPrint()
  49. {
  50. printf "$1" $2 $3 $4 $5 $6 $7 $8 $9 >&2
  51. Log "$1" $2 $3 $4 $5 $6 $7 $8 $9
  52. }
  53. XCOMM ==========================================================================
  54. XCOMM
  55. XCOMM DtiShow - echo to stdout
  56. XCOMM
  57. XCOMM Input
  58. XCOMM $1 - data to echo to stdout
  59. XCOMM Output - none
  60. XCOMM Return -none
  61. XCOMM ==========================================================================
  62. DtiShow()
  63. {
  64. printf "$1" $2 $3 $4 $5 $6 $7 $8 $9 >&2
  65. }
  66. XCOMM ==========================================================================
  67. XCOMM
  68. XCOMM DtiReturn - return a string to stdout
  69. XCOMM
  70. XCOMM Input
  71. XCOMM $1 - data to return
  72. XCOMM Output - none
  73. XCOMM Return -none
  74. XCOMM ==========================================================================
  75. DtiReturn()
  76. {
  77. echo "$1"
  78. }
  79. XCOMM ==========================================================================
  80. XCOMM
  81. XCOMM DtiWhoami
  82. XCOMM
  83. XCOMM Input - none
  84. XCOMM Output - none
  85. XCOMM Return
  86. XCOMM result of system 'whoami' command
  87. XCOMM
  88. XCOMM ==========================================================================
  89. DtiWhoami()
  90. {
  91. $WHOAMI_PATH/whoami
  92. }
  93. XCOMM ==========================================================================
  94. XCOMM
  95. XCOMM Exit - log and exit
  96. XCOMM
  97. XCOMM Input
  98. XCOMM $1 - data to echo to log
  99. XCOMM Output - none
  100. XCOMM Return -none
  101. XCOMM ==========================================================================
  102. Exit()
  103. {
  104. Log "\n==================================================================\n"
  105. Log "* $(date) $($WHOAMI_PATH/whoami)@$(hostname)*"
  106. Log "* $1*"
  107. Log "\n*exit_code = $2*"
  108. Log "\n==================================================================\n"
  109. exit $2
  110. }
  111. XCOMM ==========================================================================
  112. XCOMM
  113. XCOMM GetPlatform
  114. XCOMM
  115. XCOMM Input - none
  116. XCOMM Output - none
  117. XCOMM Return
  118. XCOMM "hpux"
  119. XCOMM "aix"
  120. XCOMM "sun"
  121. XCOMM "uxp"
  122. XCOMM "usl"
  123. XCOMM "dec"
  124. XCOMM ==========================================================================
  125. GetPlatform()
  126. {
  127. if [ -z "$getPlatform" ]; then
  128. os=`uname -s`
  129. case $os in
  130. *HP-UX*) getPlatform=hp;;
  131. *AIX*) getPlatform=ibm;;
  132. *SunOS*) getPlatform=sun;;
  133. *UNIX_System_V*) getPlatform=uxp;;
  134. *UNIX_SV*) getPlatform=usl;;
  135. *OSF1*) getPlatform=dec;;
  136. esac
  137. fi
  138. DtiReturn $getPlatform
  139. }
  140. XCOMM ==========================================================================
  141. XCOMM
  142. XCOMM ValidOS - Verify OS is valid to deinstall on
  143. XCOMM
  144. XCOMM Input - none
  145. XCOMM Output - Error message if invalid platform, will exit.
  146. XCOMM Return
  147. XCOMM "hpux"
  148. XCOMM "aix"
  149. XCOMM "sun"
  150. XCOMM "uxp"
  151. XCOMM "usl"
  152. XCOMM "dec"
  153. XCOMM ==========================================================================
  154. ValidOS()
  155. {
  156. platform=$(GetPlatform)
  157. case "$platform" in
  158. hp|ibm|sun|uxp|usl|dec)
  159. DtiReturn $platform
  160. ;;
  161. *) Exit $INVALID_OS_MSG 1
  162. ;;
  163. esac
  164. }
  165. XCOMM ==========================================================================
  166. XCOMM
  167. XCOMM ResolvePathName
  168. XCOMM
  169. XCOMM Input - File Name to be resolved to actual file
  170. XCOMM Output - none
  171. XCOMM Return
  172. XCOMM Actual File Name resolved down to through all links
  173. XCOMM
  174. XCOMM ==========================================================================
  175. ResolvePathName() {
  176. if [ "/" = "$1" ]; then
  177. echo $1$2
  178. elif [ -L $1 ]; then
  179. ResolvePathName `/bin/ls -l $1 | awk '{print $NF}'` $2
  180. else
  181. ResolvePathName `dirname $1` `basename $1`${2+/}$2
  182. fi
  183. }
  184. XCOMM ==========================================================================
  185. XCOMM
  186. XCOMM FileIsLink
  187. XCOMM
  188. XCOMM Input - File Name
  189. XCOMM Output - none
  190. XCOMM Return
  191. XCOMM TRUE, if file is a link
  192. XCOMM FALSE, if file is not a link
  193. XCOMM ==========================================================================
  194. FileIsLink() {
  195. if [[ -L $1 ]] && [[ -a $1 ]]
  196. then
  197. DtiReturn "TRUE"
  198. else
  199. DtiReturn "FALSE"
  200. fi
  201. }
  202. XCOMM ==========================================================================
  203. XCOMM
  204. XCOMM StateObjective - States the objective of the Script to the user
  205. XCOMM
  206. XCOMM Input - none
  207. XCOMM Output - none
  208. XCOMM
  209. XCOMM ==========================================================================
  210. StateObjective() {
  211. XCOMM Display information to the user, ask if user wishes to continue
  212. while :
  213. do
  214. DtiClearScreen
  215. DtiShow "$HERALD_MSG"
  216. DtiPrint "$OBJECTIVE_MSG"
  217. DtiPrint "$YESNO_MSG"
  218. read response
  219. Log "$RESPONSE_MSG"
  220. Log "$response"
  221. Log "\n"
  222. case $response in
  223. [yY]*) return 0
  224. ;;
  225. [nN]*) exit 0
  226. ;;
  227. *) continue
  228. esac
  229. done
  230. }
  231. XCOMM ==========================================================================
  232. XCOMM
  233. XCOMM DoFilesetScript - Runs a unconfiguration script in the post_install dirs
  234. XCOMM
  235. XCOMM Input - none
  236. XCOMM Output - none
  237. XCOMM
  238. XCOMM ==========================================================================
  239. DoFilesetScript()
  240. {
  241. FilesetName=$1
  242. HASH
  243. HASH Check for the lowercase PLATFORM dir. If doesn't exist then
  244. HASH the tree is in uppercase.
  245. HASH
  246. if [ ! -f $TAR_TREE/dt.pkg ];
  247. then
  248. typeset -u ScriptName
  249. fi
  250. if [ "$BUILD_TREE" = "" ]
  251. then
  252. ScriptName=$3
  253. else
  254. ScriptName=$2
  255. fi
  256. test_string=${DATABASE_FILES#*$FilesetName}
  257. if (( ${#DATABASE_FILES} > ${#test_string} ))
  258. then
  259. if [ -x $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName ]
  260. then
  261. DtiPrint "\n\nExecuting $PLATFORM specific $FilesetName unconfigure script...\n"
  262. $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName -d 2>&1 | \
  263. tee -a $LOG_FILE
  264. elif [ -x $POST_INSTALL_DIR/$ScriptName ]
  265. then
  266. DtiPrint "\n\nExecuting $FilesetName unconfigure script...\n"
  267. $POST_INSTALL_DIR/$ScriptName -d 2>&1 | tee -a $LOG_FILE
  268. fi
  269. fi
  270. }
  271. XCOMM ==========================================================================
  272. XCOMM
  273. XCOMM RunUnconfigScripts - Runs relevant unconfiguration scripts, based on
  274. XCOMM fileset installed, calls DoFilesetScript
  275. XCOMM Input - none
  276. XCOMM Output - none
  277. XCOMM
  278. XCOMM ==========================================================================
  279. RunUnconfigScripts()
  280. {
  281. DtiPrint "\n\nRunning unconfigure scripts...\n"
  282. DoFilesetScript CDE-TT configTT tt.cfg
  283. DoFilesetScript CDE-MIN configMin min.cfg
  284. DoFilesetScript CDE-RUN configRun run.cfg
  285. DoFilesetScript CDE-HELP configHelp help.cfg
  286. DoFilesetScript CDE-HELP-PRG configHelpPrg helpprg.cfg
  287. DoFilesetScript CDE-HELP-RUN configHelpRun helprun.cfg
  288. DoFilesetScript CDE-SHLIBS configShlibs shlibs.cfg
  289. DoFilesetScript CDE-AB configAb ab.cfg
  290. DoFilesetScript CDE-DEMOS configDemos demos.cfg
  291. DoFilesetScript CDE-ICONS configIcons icons.cfg
  292. DoFilesetScript CDE-INC configInc inc.cfg
  293. DoFilesetScript CDE-MAN configMan man.cfg
  294. DoFilesetScript CDE-MAN-DEV configManDev mandev.cvg
  295. DoFilesetScript CDE-MSG-CAT configMsgCat msgcat.cfg
  296. DoFilesetScript CDE-PRG configPrg prg.cfg
  297. }
  298. XCOMM ==========================================================================
  299. XCOMM
  300. XCOMM ValidConfiguration - Checks to see if the desktop was installed or
  301. XCOMM partially installed on your system
  302. XCOMM
  303. XCOMM Input - none
  304. XCOMM Output - none
  305. XCOMM Return - TRUE, if valid configuration
  306. XCOMM FALSE, for no desktop was found on the system
  307. XCOMM
  308. XCOMM ==========================================================================
  309. ValidConfiguration() {
  310. if (( [[ -a $ABSOLUTE_USR_LOCATION ]] || [[ -a $DEFAULT_USR_LOCATION ]] ) &&
  311. ( [[ -a $ABSOLUTE_ETC_LOCATION ]] || [[ -a $DEFAULT_ETC_LOCATION ]] ) &&
  312. ( [[ -a $ABSOLUTE_VAR_LOCATION ]] || [[ -a $DEFAULT_VAR_LOCATION ]] ))
  313. then
  314. DtiReturn "TRUE"
  315. else
  316. STATUS="FALSE"
  317. for i in $ABSOLUTE_USR_LOCATION $ABSOLUTE_ETC_LOCATION \
  318. $ABSLOUTE_VAR_LOCATION $DEFAULT_USR_LOCATION \
  319. $DEFAULT_ETC_LOCATION $DEFAULT_VAR_LOCATION
  320. do
  321. if [ -a $i ]
  322. then
  323. STATUS="TRUE"
  324. break
  325. fi
  326. done
  327. DtiReturn "$STATUS"
  328. fi
  329. }
  330. XCOMM ==========================================================================
  331. XCOMM
  332. XCOMM DisplayDirs - Determines if directories should be presented
  333. XCOMM to the user to determin if they will be deleted or not.
  334. XCOMM
  335. XCOMM
  336. XCOMM Input - none
  337. XCOMM Output - none
  338. XCOMM Return - TRUE, if some directories will be deleted
  339. XCOMM FALSE, if NO directories will be deleted
  340. XCOMM
  341. XCOMM ==========================================================================
  342. DisplayDirs() {
  343. if [[ -d $ABSOLUTE_USR_LOCATION ]] && [[ -a $ABSOLUTE_USR_LOCATION ]]
  344. then
  345. DtiReturn "TRUE"
  346. elif [[ -d $ABSOLUTE_ETC_LOCATION ]] && [[ -a $ABSOLUTE_ETC_LOCATION ]]
  347. then
  348. DtiReturn "TRUE"
  349. elif
  350. [[ -d $ABSOLUTE_VAR_LOCATION ]] && [[ -a $ABSOLUTE_VAR_LOCATION ]]
  351. then
  352. DtiReturn "TRUE"
  353. else
  354. DtiReturn "FALSE"
  355. fi
  356. }
  357. XCOMM ==========================================================================
  358. XCOMM
  359. XCOMM DisplayDirs - Determines if links should be presented
  360. XCOMM to the user to determine if they will be deleted or not.
  361. XCOMM
  362. XCOMM
  363. XCOMM Input - none
  364. XCOMM Output - none
  365. XCOMM Return - TRUE, if some links will be deleted
  366. XCOMM FALSE, if NO links will be deleted
  367. XCOMM
  368. XCOMM ==========================================================================
  369. DisplayLinks() {
  370. if [[ -L $DEFAULT_USR_LOCATION ]] && [[ -a $DEFAULT_USR_LOCATION ]]
  371. then
  372. DtiReturn "TRUE"
  373. elif [[ -L $DEFAULT_ETC_LOCATION ]] && [[ -a $DEFAULT_ETC_LOCATION ]]
  374. then
  375. DtiReturn "TRUE"
  376. elif
  377. [[ -L $DEFAULT_VAR_LOCATION ]] && [[ -a $DEFAULT_VAR_LOCATION ]]
  378. then
  379. DtiReturn "TRUE"
  380. else
  381. DtiReturn "FALSE"
  382. fi
  383. }
  384. XCOMM ==========================================================================
  385. XCOMM
  386. XCOMM ShowDirsToBeDeleted - Shows what dirs and links will be deleted to the user
  387. XCOMM
  388. XCOMM Input - none
  389. XCOMM Output - none
  390. XCOMM
  391. XCOMM ==========================================================================
  392. ShowDirsToBeDeleted() {
  393. XCOMM Display information to the user, ask if user wishes to continue
  394. while :
  395. do
  396. DtiClearScreen
  397. DtiShow "$HERALD_MSG"
  398. if [ $(DisplayDirs) = "TRUE" ]
  399. then
  400. DtiPrint "$DELETE_DIRS_MSG"
  401. if [ -a $ABSOLUTE_USR_LOCATION ]
  402. then
  403. DtiPrint "$DIR_MSG" "$ABSOLUTE_USR_LOCATION"
  404. fi
  405. if [ -a $ABSOLUTE_ETC_LOCATION ]
  406. then
  407. DtiPrint "$DIR_MSG" "$ABSOLUTE_ETC_LOCATION"
  408. fi
  409. if [ -a $ABSOLUTE_VAR_LOCATION ]
  410. then
  411. DtiPrint "$DIR_MSG" "$ABSOLUTE_VAR_LOCATION"
  412. fi
  413. fi
  414. if [ $(DisplayLinks) = "TRUE" ]
  415. then
  416. DtiPrint "\n\n$DELETE_LINKS_MSG"
  417. if [ $(FileIsLink $DEFAULT_USR_LOCATION) = "TRUE" ]
  418. then
  419. DtiPrint "$LINK_DIR_MSG" "$DEFAULT_USR_LOCATION"
  420. fi
  421. if [ $(FileIsLink $DEFAULT_ETC_LOCATION) = "TRUE" ]
  422. then
  423. DtiPrint "$LINK_DIR_MSG" "$DEFAULT_ETC_LOCATION"
  424. fi
  425. if [ $(FileIsLink $DEFAULT_VAR_LOCATION) = "TRUE" ]
  426. then
  427. DtiPrint "$LINK_DIR_MSG" "$DEFAULT_VAR_LOCATION"
  428. fi
  429. fi
  430. DtiPrint "\n\n$WARNING_MSG"
  431. DtiPrint "\n\n\n$YESNO_MSG"
  432. read response
  433. Log "$RESPONSE_MSG"
  434. Log "$response"
  435. Log "\n"
  436. case $response in
  437. [yY]*) return 0
  438. ;;
  439. [nN]*) exit 0
  440. ;;
  441. *) continue
  442. esac
  443. done
  444. }
  445. XCOMM ==========================================================================
  446. XCOMM
  447. XCOMM StopDesktop - Stops the desktop if it was running
  448. XCOMM
  449. XCOMM Input - none
  450. XCOMM Output - none
  451. XCOMM
  452. XCOMM ==========================================================================
  453. StopDesktop() {
  454. if [ -f $ABSOLUTE_VAR_LOCATION/Xpid ]
  455. then
  456. DtiPrint "\n\nStopping Desktop... \n"
  457. kill -TERM `cat $ABSOLUTE_VAR_LOCATION/Xpid` 2> /dev/null
  458. fi
  459. }
  460. XCOMM ==========================================================================
  461. XCOMM
  462. XCOMM RemoveDesktop - Deletes Desktop files from the system
  463. XCOMM
  464. XCOMM Input - none
  465. XCOMM Output - none
  466. XCOMM
  467. XCOMM ==========================================================================
  468. RemoveDesktop () {
  469. DtiPrint "Removing files from Desktop Directories...\n"
  470. rm -rf $ABSOLUTE_USR_LOCATION
  471. rm -rf $ABSOLUTE_ETC_LOCATION
  472. rm -rf $ABSOLUTE_VAR_LOCATION
  473. rm -rf $DEFAULT_USR_LOCATION
  474. rm -rf $DEFAULT_ETC_LOCATION
  475. rm -rf $DEFAULT_VAR_LOCATION
  476. DtiPrint "The Desktop was successfully removed from your system.\n"
  477. }
  478. XCOMM ==========================================================================
  479. XCOMM
  480. XCOMM
  481. XCOMM This is the MAIN of the script
  482. XCOMM
  483. XCOMM
  484. XCOMM ==========================================================================
  485. XCOMM Set up Messages
  486. USAGE_MSG="\
  487. Usage: deinstall.dt [-noprompt]\n"
  488. PERMISSION_MSG="\
  489. You must be ROOT to run this command\n"
  490. RESPONSE_MSG="\n
  491. response is: "
  492. HERALD_MSG="\
  493. The Common Open Systems Environment Desktop\n\
  494. April 1994 Snapshot Deinstallation Procedure\n\n"
  495. OBJECTIVE_MSG="\
  496. This procedure will REMOVE the Desktop from your system.\n\n\n"
  497. YESNO_MSG="\
  498. Do you wish to continue? [y/n] "
  499. DELETE_DIRS_MSG="\
  500. The deinstallation will remove files from the following\n\
  501. directories listed below:\n\n"
  502. DIR_MSG="\
  503. '%s'\n"
  504. DELETE_LINKS_MSG="\
  505. The deinstallation will remove the following symbolic \n\
  506. link(s) listed below:\n\n"
  507. LINK_DIR_MSG="\
  508. '%s'\n"
  509. WARNING_MSG="\
  510. Any customizations made will be LOST!\n"
  511. INVALID_OS_MSG="\
  512. The Desktop does not support this system configuration.\n\
  513. The deinstallation procedure will terminate.\n"
  514. INVALID_CONFIGURATION_MSG="\
  515. The deinstallation procedure could not locate any Desktop files\n\
  516. on your system. The deinstallation will terminate. Please check\n\
  517. that you are running the deinstallation script on a system that\n\
  518. has the Desktop already installed.\n"
  519. XCOMM Set up variables
  520. NO_PROMPT="FALSE"
  521. DEFAULT_USR_LOCATION="/usr/dt"
  522. DEFAULT_ETC_LOCATION="/etc/dt"
  523. DEFAULT_VAR_LOCATION="/var/dt"
  524. ABSOLUTE_USR_LOCATION=$(ResolvePathName $DEFAULT_USR_LOCATION)
  525. ABSOLUTE_ETC_LOCATION=$(ResolvePathName $DEFAULT_ETC_LOCATION)
  526. ABSOLUTE_VAR_LOCATION=$(ResolvePathName $DEFAULT_VAR_LOCATION)
  527. XCOMM Set up the log file
  528. LOG_FILE="/tmp/dinstall.dt.log"
  529. if [ -f $LOG_FILE ]
  530. then
  531. rm -rf $LOG_FILE 2>/dev/null
  532. fi
  533. touch $LOG_FILE 2>/dev/null
  534. chmod 777 $LOG_FILE 2>/dev/null
  535. XCOMM change directories to deinstall.dt location as all
  536. XCOMM installation packages are relative to this
  537. XCOMM
  538. if [ ${0%/STAR} != "dinstall.dt" ]; then
  539. cd ${0%/STAR}
  540. fi
  541. XCOMM set up the TOP directory of where the CD is mounted
  542. TOP=`pwd`
  543. XCOMM set up the path for whoami command
  544. WHOAMI_PATH=/bin
  545. platform=$(GetPlatform)
  546. case "$platform" in
  547. hp) WHOAMI_PATH=/usr/bin
  548. ;;
  549. ibm) WHOAMI_PATH=/bin
  550. ;;
  551. sun) WHOAMI_PATH=/usr/ucb
  552. ;;
  553. uxp) WHOAMI_PATH=/usr/ucb
  554. ;;
  555. usl) WHOAMI_PATH=/usr/ucb
  556. ;;
  557. dec) WHOAMI_PATH=/usr/bin
  558. ;;
  559. esac
  560. DTIDINSTALLDT=dinstall.dt
  561. DTICONFIGDIR=config
  562. dtiPlatform=$(GetPlatform)
  563. DTIPLATFORMDIR=$dtiPlatform
  564. DTIREADME=config/config.$dtiPlatform
  565. if [ ${0##STAR/} != $DTIDINSTALLDT ]; then
  566. HASH
  567. HASH CDROM driver folds filenames to uppercase
  568. HASH
  569. typeset -u DTIDINSTALLDT
  570. typeset -u DTICONFIGDIR
  571. typeset -u DTIPLATFORMDIR
  572. typeset -u DTIREADME
  573. fi
  574. XCOMM Parse the command line
  575. while [ $# -ne 0 ];
  576. do
  577. case $1 in
  578. -noprompt) NO_PROMPT=TRUE
  579. print "NO_PROMPT is set"
  580. shift
  581. ;;
  582. *) print "$USAGE_MSG"
  583. DtiPrint $USAGE
  584. exit 1;;
  585. esac
  586. done
  587. XCOMM Verify that we have the Root User
  588. if [ $(DtiWhoami) != "root" ]
  589. then
  590. DtiShow "$PERMISSION_MSG"
  591. Exit "$PERMISSION_MSG" 1
  592. fi
  593. XCOMM Check to see if the Desktop is actually installed on the system
  594. if [ $(ValidConfiguration ) != "TRUE" ]
  595. then
  596. DtiPrint "$INVALID_CONFIGURATION_MSG"
  597. exit 1
  598. fi
  599. XCOMM Determine if the OS is supported
  600. PLATFORM=$(ValidOS)
  601. XCOMM
  602. XCOMM Initially PLATFORM is in lower case.
  603. XCOMM Check if the $PLATFORM directory exists.
  604. XCOMM if doesn't exist translate all to upper case.
  605. XCOMM
  606. if [ -d $PLATFORM ]
  607. then
  608. TAR_TREE=$TOP/$PLATFORM
  609. POST_INSTALL_DIR=$TAR_TREE/config
  610. DATABASE_FILES=$(awk 'BEGIN {FS=":"} /FILESETS: /{print $2}' $TAR_TREE/dt.pkg 2>/dev/null)
  611. else
  612. PLATFORM=`echo "$PLATFORM" | /usr/bin/tr "[a-z]" "[A-Z]"`
  613. TAR_TREE=$TOP/$PLATFORM
  614. POST_INSTALL_DIR=$TAR_TREE/CONFIG
  615. DATABASE_FILES=$(awk 'BEGIN {FS=":"} /FILESETS: /{print $2}' $TAR_TREE/DT.PKG 2>/dev/null)
  616. fi
  617. XCOMM Tell the user what is going to happen
  618. if [ $NO_PROMPT = FALSE ]
  619. then
  620. StateObjective
  621. fi
  622. XCOMM Show the user what directories are going to be deleted
  623. if [ $NO_PROMPT = FALSE ]
  624. then
  625. ShowDirsToBeDeleted
  626. fi
  627. XCOMM Stop the Desktop
  628. StopDesktop
  629. XCOMM Run the Unconfigure Scripts
  630. RunUnconfigScripts
  631. XCOMM Remove the Desktop Files
  632. RemoveDesktop