6 # @(#) $XConsortium: configMin /main/1 1995/09/15 17:48:04 cde-hp $
9 # (c) Copyright Hewlett-Packard Company, 1993
23 CreateVarDtDirectory()
25 if [ -x /bin/getcontext ]
27 if [ `/bin/getcontext | awk '{print $1}'` != "standalone" ]
29 base=${DT_TEMP_TOP%/*}
34 if [ ! -d $DT_TEMP_TOP ]
37 exec 3< /etc/clusterconf
41 while read -u3 lanid node name id num1 num2
45 CONTEXT="$CONTEXT -c $name"
52 makecdf $CONTEXT $DT_TEMP_TOP
61 TMPFILE="/tmp/etc-services"
64 # check for existence of /etc/services
67 if [ ! -f $FILE ] # highly unlikely
73 # see if it already exists
76 awk '{if ($1 == "dtspc")
77 print $0 > "/tmp/dtspc-already-there"
80 if [ ! -f /tmp/dtspc-already-there ]
82 echo "dtspc\t6112/tcp\t#subprocess control" >>$FILE
84 rm /tmp/dtspc-already-there
88 # remove legacy entries like dtspcd
91 awk '{if ($1 == "dtspcd" || $1 == "#dtspcd")
104 TMPFILE="/tmp/etc-services"
106 awk '{if ($1 == "dtspc" && $2 == "6112/tcp")
117 FILE="/etc/inetd.conf"
118 TMPFILE="/tmp/inetd.conf.$$"
121 # check for existence of /etc/inetd.conf
124 if [ ! -f $FILE ] # highly unlikely
129 awk '{if ($1 == "dtspc" || $1 == "dtspcd" || $1 == "#dtspcd")
138 DTSPCD=/usr/dt/bin/dtspcd
140 echo "dtspc stream tcp nowait root $DTSPCD $DTSPCD -mount_point $DTMOUNTPOINT" >>$FILE
145 FILE="/etc/inetd.conf"
146 TMPFILE="/tmp/inetd.conf"
148 awk '{if ($1 == "dtspc")
159 FILE="/usr/adm/inetd.sec"
160 TMPFILE="/tmp/new-inetd.sec"
163 # check for existence of /usr/adm/inetd.sec
166 if [ ! -f $FILE ] # highly unlikely
172 # remove legacy entries
175 awk '{if ($1 == "dtspcd")
184 # see if it already exists
187 awk '{if ($1 == "dtspc")
188 print $0 > "/tmp/dtspc-already-there"
191 if [ ! -f /tmp/dtspc-already-there ]
193 echo "dtspc\tallow\t127.0.0.1\t$hostname" >>$FILE
195 status=`grep -q $hostname /tmp/dtspc-already-there`
196 if [[ $status -ne 0 ]]
198 cat /tmp/dtspc-already-there >> $FILE
199 awk -v hname=$hostname \
209 rm /tmp/dtspc-already-there
216 FILE="/usr/adm/inetd.sec"
217 TMPFILE="/tmp/new-inetd.sec"
219 awk '{if ($1 == "dtspc")
239 while [ "$dirname" != "$CDE_TOP" ]
242 rmdir ${dirname##*/} >/dev/null 2>/dev/null
243 dirname=${dirname%/*}
249 /usr/dt/lib/dtksh/DtFuncs.dtsh
251 /usr/dt/bin/dtappintegrate
253 /usr/dt/bin/suid_exec
254 /usr/dt/app-defaults/C/Dtksh
255 /usr/dt/config/dtspcdenv
260 VerifyInstalledFiles()
262 echo "Status mode owner group filename"
263 echo "-----------------------------------------"
264 # exists correct correct correct /usr/dt/foo1
265 # MISSING WRONG WRONG WRONG /usr/dt/foo2
266 # exists the link is correct /usr/dt/link
273 if [ "${tokens[3]}" = "file" ]
275 if [ -f ${tokens[0]} ]
279 echo "MISSING or REMOVED \c"
283 elif [ "${tokens[3]}" = "sym_link" ]
285 if [ -L ${tokens[0]} ]
289 echo "MISSING or REMOVED \c"
295 if [ "${tokens[3]}" = "file" ]
297 touch /tmp/config-test
298 chmod ${tokens[1]} /tmp/config-test
299 tmpperms=`ls -l /tmp/config-test | awk '{print $1}'`
300 realperms=`ls -l ${tokens[0]} | awk '{print $1}'`
302 if [ "$tmpperms" = "$realperms" ]
309 owner=`ls -l ${tokens[0]} | awk '{print $3}'`
311 if [ "$owner" = "${tokens[4]}" ]
318 group=`ls -l ${tokens[0]} | awk '{print $4}'`
320 if [ "$group" = "${tokens[5]}" ]
326 elif [ "${tokens[3]}" = "sym_link" ]
328 linkto=`ls -l ${tokens[0]} | awk '{print $11}'`
329 if [ "${tokens[2]}" = "$linkto" ]
331 echo " the link is correct \c"
333 echo " the link is WRONG \c"
339 /usr/dt/copyright 0444 copyright file bin bin di---- 378 cde_dt
340 /usr/dt/lib/dtksh/DtFuncs.dtsh 0444 cde1/dtksh/DtFuncs.sh file bin bin di---- 378 cde_dt
341 /usr/dt/bin/dtspcd 0555 cde1/dtspcd/dtspcd file bin bin di---- 378 cde_dt
342 /usr/dt/bin/dtappintegrate 0555 cde1/dtappintegrate/dtappintegrate file bin bin di---- 378 cde_dt
343 /usr/dt/bin/dtksh 0555 cde1/dtksh/dtksh file bin bin di---- 378 cde_dt
344 /usr/dt/bin/suid_exec 0555 cde1/dtksh/ksh93/bin/suid_exec file root bin di---- 378 cde_dt
345 /usr/dt/app-defaults/C/Dtksh 0444 cde1/dtksh/Dtksh file bin bin di---- 378 cde_dt
346 /usr/dt/config/dtspcdenv 0444 cde1/dtspcd/dtspcdenv file bin bin di---- 378 cde_dt
347 /usr/dt/bin/dtexec 0555 cde1/dtexec/dtexec file bin bin di---- 378 cde_dt
356 echo "Size\t\tfilename"
357 echo "-----------------------------------------"
364 if [ "${tokens[3]}" = "file" ]
366 if [ -f ${tokens[0]} ]
368 filesize=`ls -l ${tokens[0]} | awk '{print $5}'`
369 echo "$filesize\t\t\c"
371 let total=total+filesize
376 /usr/dt/copyright 0444 copyright file bin bin di---- 378 cde_dt
377 /usr/dt/lib/dtksh/DtFuncs.dtsh 0444 cde1/dtksh/DtFuncs.sh file bin bin di---- 378 cde_dt
378 /usr/dt/bin/dtspcd 0555 cde1/dtspcd/dtspcd file bin bin di---- 378 cde_dt
379 /usr/dt/bin/dtappintegrate 0555 cde1/dtappintegrate/dtappintegrate file bin bin di---- 378 cde_dt
380 /usr/dt/bin/dtksh 0555 cde1/dtksh/dtksh file bin bin di---- 378 cde_dt
381 /usr/dt/bin/suid_exec 0555 cde1/dtksh/ksh93/bin/suid_exec file root bin di---- 378 cde_dt
382 /usr/dt/app-defaults/C/Dtksh 0444 cde1/dtksh/Dtksh file bin bin di---- 378 cde_dt
383 /usr/dt/config/dtspcdenv 0444 cde1/dtspcd/dtspcdenv file bin bin di---- 378 cde_dt
384 /usr/dt/bin/dtexec 0555 cde1/dtexec/dtexec file bin bin di---- 378 cde_dt
386 echo "Total fileset size is $total"
390 while [ $# -ne 0 ]; do
392 -e) OPERATION="configure"
395 -d) OPERATION="deconfigure"
398 -v) OPERATION="verify"
408 #####################################################################
412 #####################################################################
417 if [ "$OPERATION" = "configure" ]
419 echo "Configuring for CDE-MIN"
424 # source in /etc/src.sh to get the DTMOUNTPOINT value
434 # force inetd to reread its configuration file
440 # create the /var/dt/tmp directory for the dtspcd
445 if [ ! -d /var/dt/tmp ]
448 chmod -R 755 /var/dt/tmp
451 chmod 755 /usr/dt /etc/dt
453 elif [ "$OPERATION" = "deconfigure" ]
455 echo "de-Configuring CDE-MIN"
464 # force inetd to reread its configuration file
473 elif [ "$OPERATION" = "verify" ]
478 elif [ "$OPERATION" = "size" ]