Remove Unixware and openserver support
[oweals/cde.git] / cde / admin / IntegTools / updateTools / updateCDE.src
1 XCOMM! /bin/ksh
2 XCOMM $XConsortium: updateCDE.src /main/6 1996/04/23 11:10:35 drk $
3 XCOMM
4 XCOMM  updateCDE  or updateCDE.and.stomp.current.bits
5 XCOMM
6 XCOMM  Jerrie Andreas  10/5/93
7 XCOMM
8 XCOMM  This script kills any desktop "dt" clients that are currently running,
9 XCOMM  and then calls installCDE to install bits, passing all parameters to
10 XCOMM  installCDE.  It then (on hp systems) changes run level to 5, the default
11 XCOMM  run level for starting the desktop.
12 XCOMM
13 XCOMM  This script uses the same options as installCDE.
14 XCOMM
15 XCOMM  Example: updateCDE -s /x/cde_hp700_90 -t /x/cde_savetars
16 XCOMM
17 XCOMM #########################################################################
18
19 #define HASH #
20
21   if [ $# -eq 0 ]
22   then
23     echo "Usage: updateCDE -s <source> [options]"
24     exit 1
25   fi
26
27   if [ "$1" != "-s" ]
28   then
29     echo "First argument must be the -s option."
30     exit 1
31   fi
32
33   SOURCE_TREE=$2
34
35 XCOMM Set which system we are on
36
37   BUILDSYSTEM=$(uname)
38
39 XCOMM Set system
40  
41   if [ $BUILDSYSTEM = "AIX" ]
42   then
43     PLATFORM=aix
44   elif [ $BUILDSYSTEM = "SunOS" ]
45   then
46     PLATFORM=sun
47   elif [ $BUILDSYSTEM = "OSF1" ]
48   then
49     PLATFORM=dec
50   else          # Build system = HP
51     PLATFORM=hp-ux
52   fi
53
54   if [ $PLATFORM = "aix" ]
55   then
56     USER=`/bin/whoami`
57   elif [ $PLATFORM = "sun" ]
58   then
59     USER=`/usr/ucb/whoami`
60   else
61     USER=`/usr/bin/whoami`
62   fi
63
64   if [ $USER != "root" ]
65   then
66     echo ""
67     echo "You must be root to run this script"
68     echo ""
69     exit 1
70   fi
71
72   echo "updateCDE:  This script re-installs bits from the daily build trees."
73   echo ""
74
75   sleep 2
76
77   PATH=/bin:/usr/bin:/etc:/usr/bin/X11:
78   export PATH
79
80 XCOMM Change the run level to kill all dtlogins
81
82   if [ $PLATFORM = "hp-ux" ]
83   then
84     /etc/telinit 2
85   elif [ $PLATFORM = "sun" ]
86   then
87     CDE_INSTALLATION_TOP/config/dtlogin.rc stop
88   fi
89
90   TOOL_DIR=$SOURCE_TREE/admin/IntegTools/updateTools
91   DB_TOOL_DIR=$SOURCE_TREE/admin/IntegTools/dbTools
92   export TOOL_DIR DB_TOOL_DIR
93
94
95 XCOMM kill any active Common Desktop Clients
96
97   echo "Stopping any Common Desktop Clients"
98   $TOOL_DIR/kfork.dtclients
99   $TOOL_DIR/kfork.dtclients
100
101 XCOMM Send all of the parameters to installDT
102
103   $DB_TOOL_DIR/installCDE $*
104
105 XCOMM  Change run level to restart dtlogin
106
107   if [ $PLATFORM = "hp-ux" ];
108   then
109     /etc/telinit 5
110   elif [ $PLATFORM = "sun" ]
111   then
112     CDE_INSTALLATION_TOP/config/dtlogin.rc start
113   fi
114
115   echo "Done updating Common Desktop Bits."
116
117   echo "Updated Common Desktop Bits on: "        > /etc/motd
118   date                                          >> /etc/motd
119   echo "via the $TOOL_DIR/updateCDE script"     >> /etc/motd
120   echo ""                                       >> /etc/motd
121
122
123 XCOMM ###################        eof      #################