835d2074ccadab8070b4f907dbf292b4a83e92cd
[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   else          # Build system = HP
48     PLATFORM=hp-ux
49   fi
50
51   if [ $PLATFORM = "aix" ]
52   then
53     USER=`/bin/whoami`
54   elif [ $PLATFORM = "sun" ]
55   then
56     USER=`/usr/ucb/whoami`
57   else
58     USER=`/usr/bin/whoami`
59   fi
60
61   if [ $USER != "root" ]
62   then
63     echo ""
64     echo "You must be root to run this script"
65     echo ""
66     exit 1
67   fi
68
69   echo "updateCDE:  This script re-installs bits from the daily build trees."
70   echo ""
71
72   sleep 2
73
74   PATH=/bin:/usr/bin:/etc:/usr/bin/X11:
75   export PATH
76
77 XCOMM Change the run level to kill all dtlogins
78
79   if [ $PLATFORM = "hp-ux" ]
80   then
81     /etc/telinit 2
82   elif [ $PLATFORM = "sun" ]
83   then
84     CDE_INSTALLATION_TOP/config/dtlogin.rc stop
85   fi
86
87   TOOL_DIR=$SOURCE_TREE/admin/IntegTools/updateTools
88   DB_TOOL_DIR=$SOURCE_TREE/admin/IntegTools/dbTools
89   export TOOL_DIR DB_TOOL_DIR
90
91
92 XCOMM kill any active Common Desktop Clients
93
94   echo "Stopping any Common Desktop Clients"
95   $TOOL_DIR/kfork.dtclients
96   $TOOL_DIR/kfork.dtclients
97
98 XCOMM Send all of the parameters to installDT
99
100   $DB_TOOL_DIR/installCDE $*
101
102 XCOMM  Change run level to restart dtlogin
103
104   if [ $PLATFORM = "hp-ux" ];
105   then
106     /etc/telinit 5
107   elif [ $PLATFORM = "sun" ]
108   then
109     CDE_INSTALLATION_TOP/config/dtlogin.rc start
110   fi
111
112   echo "Done updating Common Desktop Bits."
113
114   echo "Updated Common Desktop Bits on: "        > /etc/motd
115   date                                          >> /etc/motd
116   echo "via the $TOOL_DIR/updateCDE script"     >> /etc/motd
117   echo ""                                       >> /etc/motd
118
119
120 XCOMM ###################        eof      #################