6 # @(#) $XConsortium: configTT /main/2 1996/03/06 19:09:08 barstow $
9 # (c) Copyright Hewlett-Packard Company, 1993
18 TMPFILE=/tmp/inetd.conf
20 TTDBSERVERD=/usr/dt/bin/rpc.ttdbserver
21 OLDTTDBSERVERD=/usr/dt/bin/rpc.ttdbserverd
23 awk -v ttdb=$TTDBSERVERD -v oldttdb=$OLDTTDBSERVERD '{
24 if ($6 == ttdb || $6 == oldttdb)
33 echo "rpc stream tcp swait root $TTDBSERVERD 100083 1 $TTDBSERVERD -m /nfs/" >>$FILE
39 FILE="/etc/inetd.conf"
40 TMPFILE="/tmp/inetd.conf"
41 TTDBSERVERD=/usr/dt/bin/rpc.ttdbserver
43 awk -v ttdb=$TTDBSERVERD \
44 '{if ($7 == "100083" && $6 == ttdb)
52 awk '{if ($1 == "#cde") {
70 echo "ttdbserver 100083" >$FILE
72 awk '{if ($1 == "ttdbserver" && $2 == "100083")
73 print $0 > "/tmp/etc-rpc-already-there"
76 if [ ! -f /tmp/etc-rpc-already-there ]
78 awk '{if ($1 == "ttdbserver" || $2 == "100083")
79 print $0 > "/tmp/etc-rpc-already-there"
82 if [ ! -f /tmp/etc-rpc-already-there ]
84 echo "ttdbserver 100083" >>$FILE
86 awk '{if ($1 == "ttdbserver" || $2 == "100083")
87 print "#cde " $0; else print $0
90 echo "ttdbserver 100083" >>$TMPFILE
93 rm /tmp/etc-rpc-already-there
96 rm /tmp/etc-rpc-already-there
104 TMPFILE="/tmp/etc-rpc"
106 awk '{if ($1 == "ttdbserver" && $2 == "100083")
114 awk '{if ($1 == "#cde") {
124 EstablishDtMountPoint()
127 TMPFILE="/tmp/etcsrcsh.$$"
130 # Ensure that the DTMOUNTPOINT environment variable will be set
131 # when anybody logs in.
134 if [[ -d /nfs && ! -d /net ]]
136 sed '/DTMOUNTPOINT=/d' $FILE >$TMPFILE
138 echo "DTMOUNTPOINT=/nfs/ ; export DTMOUNTPOINT" >>$TMPFILE
140 if [ ! -f ${FILE}.pre-cde ]
142 mv $FILE ${FILE}.pre-cde
149 DeestablishDtMountPoint()
152 TMPFILE="/tmp/etc-src.sh"
154 if [ -f ${FILE}.pre-cde ]
156 mv ${FILE}.pre-cde $FILE
158 sed '/DTMOUNTPOINT=/d' $FILE >$TMPFILE
165 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
166 if [ -s /tmp/tmppsout ]
168 awk '{print "kill " $2}' /tmp/tmppsout | /bin/ksh
170 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
171 if [ -s /tmp/tmppsout ]
173 awk '{print "kill -TERM " $2}' /tmp/tmppsout | /bin/ksh
175 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
176 if [ -s /tmp/tmppsout ]
178 awk '{print "kill -9 " $2}' /tmp/tmppsout | /bin/ksh
197 while [ "$dirname" != "$CDE_TOP" ]
200 rmdir ${dirname##*/} >/dev/null 2>/dev/null
201 dirname=${dirname%/*}
206 /usr/dt/bin/rpc.ttdbserver
207 /usr/dt/bin/rpc.ttdbserverd
208 /usr/dt/bin/rpc.ttdbserverd
209 /usr/dt/bin/tt_type_comp
215 /usr/dt/bin/ttsession
220 /usr/dt/appconfig/tttypes/types.xdr
224 VerifyInstalledFiles()
226 echo "Status mode owner group filename"
227 echo "-----------------------------------------"
228 # exists correct correct correct /usr/dt/foo1
229 # MISSING WRONG WRONG WRONG /usr/dt/foo2
230 # exists the link is correct /usr/dt/link
237 if [ "${tokens[3]}" = "file" ]
239 if [ -f ${tokens[0]} ]
243 echo "MISSING or REMOVED \c"
247 elif [ "${tokens[3]}" = "sym_link" ]
249 if [ -L ${tokens[0]} ]
253 echo "MISSING or REMOVED \c"
259 if [ "${tokens[3]}" = "file" ]
261 touch /tmp/config-test
262 chmod ${tokens[1]} /tmp/config-test
263 tmpperms=`ls -l /tmp/config-test | awk '{print $1}'`
264 realperms=`ls -l ${tokens[0]} | awk '{print $1}'`
266 if [ "$tmpperms" = "$realperms" ]
273 owner=`ls -l ${tokens[0]} | awk '{print $3}'`
275 if [ "$owner" = "${tokens[4]}" ]
282 group=`ls -l ${tokens[0]} | awk '{print $4}'`
284 if [ "$group" = "${tokens[5]}" ]
290 elif [ "${tokens[3]}" = "sym_link" ]
292 linkto=`ls -l ${tokens[0]} | awk '{print $11}'`
293 if [ "${tokens[2]}" = "$linkto" ]
295 echo " the link is correct \c"
297 echo " the link is WRONG \c"
303 /usr/dt/bin/rpc.ttdbserver 0555 lib/tt/bin/ttdbserverd/rpc.ttdbserver file bin bin di---- 378 cde_dt
304 /usr/dt/bin/tt_type_comp 0555 lib/tt/bin/tt_type_comp/tt_type_comp file bin bin di---- 378 cde_dt
305 /usr/dt/bin/ttcp 0555 lib/tt/bin/shell/ttcp file bin bin di---- 378 cde_dt
306 /usr/dt/bin/ttdbck 0555 lib/tt/bin/dbck/ttdbck file bin bin di---- 378 cde_dt
307 /usr/dt/bin/ttmv 0555 lib/tt/bin/shell/ttmv file bin bin di---- 378 cde_dt
308 /usr/dt/bin/ttrm 0555 lib/tt/bin/shell/ttrm file bin bin di---- 378 cde_dt
309 /usr/dt/bin/ttrmdir 0444 /usr/dt/bin/ttrm sym_link bin bin di---- 378 cde_dt
310 /usr/dt/bin/ttsession 0555 lib/tt/bin/ttsession/ttsession file bin bin di---- 378 cde_dt
311 /usr/dt/bin/tttrace 0555 lib/tt/bin/tttrace/tttrace file bin bin di---- 378 cde_dt
312 /usr/dt/bin/tttar 0555 lib/tt/bin/tttar/tttar file bin bin di---- 378 cde_dt
313 /usr/dt/bin/ttsnoop 0555 lib/tt/bin/ttsnoop/gui/ttsnoop file bin bin di---- 378 cde_dt
314 /usr/dt/appconfig/tttypes/types.xdr 0444 cde1/tttypes/types.xdr file bin bin di---- 378 cde_dt
323 echo "Size\t\tfilename"
324 echo "-----------------------------------------"
331 if [ "${tokens[3]}" = "file" ]
333 if [ -f ${tokens[0]} ]
335 filesize=`ls -l ${tokens[0]} | awk '{print $5}'`
336 echo "$filesize\t\t\c"
338 let total=total+filesize
343 /usr/dt/bin/rpc.ttdbserver 0555 lib/tt/bin/ttdbserverd/rpc.ttdbserver file bin bin di---- 378 cde_dt
344 /usr/dt/bin/tt_type_comp 0555 lib/tt/bin/tt_type_comp/tt_type_comp file bin bin di---- 378 cde_dt
345 /usr/dt/bin/ttcp 0555 lib/tt/bin/shell/ttcp file bin bin di---- 378 cde_dt
346 /usr/dt/bin/ttdbck 0555 lib/tt/bin/dbck/ttdbck file bin bin di---- 378 cde_dt
347 /usr/dt/bin/ttmv 0555 lib/tt/bin/shell/ttmv file bin bin di---- 378 cde_dt
348 /usr/dt/bin/ttrm 0555 lib/tt/bin/shell/ttrm file bin bin di---- 378 cde_dt
349 /usr/dt/bin/ttrmdir 0444 /usr/dt/bin/ttrm sym_link bin bin di---- 378 cde_dt
350 /usr/dt/bin/ttsession 0555 lib/tt/bin/ttsession/ttsession file bin bin di---- 378 cde_dt
351 /usr/dt/bin/tttrace 0555 lib/tt/bin/tttrace/tttrace file bin bin di---- 378 cde_dt
352 /usr/dt/bin/tttar 0555 lib/tt/bin/tttar/tttar file bin bin di---- 378 cde_dt
353 /usr/dt/bin/ttsnoop 0555 lib/tt/bin/ttsnoop/gui/ttsnoop file bin bin di---- 378 cde_dt
354 /usr/dt/appconfig/tttypes/types.xdr 0444 cde1/tttypes/types.xdr file bin bin di---- 378 cde_dt
356 echo "Total fileset size is $total"
360 while [ $# -ne 0 ]; do
362 -e) OPERATION="configure"
365 -d) OPERATION="deconfigure"
368 -v) OPERATION="verify"
378 #################################################################
382 #################################################################
389 if [ "$OPERATION" = "configure" ]
392 echo "Configuring for CDE-TT"
398 # After adding ToolTalk to the inetd service list the inet
399 # daemon needs to reread its configuration.
403 EstablishDtMountPoint
405 elif [ "$OPERATION" = "deconfigure" ]
408 echo "de-Configuring CDE-TT"
411 KillIt "rpc.ttdbserver"
418 # After adding ToolTalk to the inetd service list the inet
419 # daemon needs to reread its configuration.
423 DeestablishDtMountPoint
429 elif [ "$OPERATION" = "verify" ]
434 elif [ "$OPERATION" = "size" ]