123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- XCOMM! /bin/ksh
- XCOMM #######
- XCOMM Product: CDE
- XCOMM Fileset: CDE-MIN
- XCOMM configure
- XCOMM @(#) $TOG: configMin.src /main/1 1998/03/11 16:18:12 mgreess $
- XCOMM #######
- #define HASH #
- PRODUCT=CDE
- FILESET=CDE-MIN
- DO_CONFIGURATION=""
- retval=0
- FixEtcServices()
- {
- FILE=/etc/services
- TMPFILE=/tmp/services
- XCOMM
- XCOMM check for existence of /etc/services
- XCOMM
- if [ ! -f $FILE ] # highly unlikely
- then
- echo "" >$FILE
- fi
- XCOMM
- XCOMM see if it already exists
- XCOMM
- awk '{if ($1 == "dtspc")
- print $0 > "/tmp/dtspc-already-there"
- }' $FILE >/dev/null
- if [ ! -f /tmp/dtspc-already-there ]
- then
- echo "dtspc\t6112/tcp\t#subprocess control" >>$FILE
- else
- rm /tmp/dtspc-already-there
- fi
- XCOMM
- XCOMM remove legacy entries like dtspcd
- XCOMM
- awk '{if ($1 == "dtspcd" || $1 == "#dtspcd")
- ;
- else
- print $0
- }' $FILE >$TMPFILE
- cp $TMPFILE $FILE
- rm $TMPFILE
- }
- UnfixEtcServices()
- {
- FILE=/etc/services
- TMPFILE=/tmp/services
- awk '{if ($1 == "dtspc" && $2 == "6112/tcp")
- ;
- else
- print $0
- }' $FILE >$TMPFILE
- cp $TMPFILE $FILE
- rm $TMPFILE
- }
- FixEtcInetdDotConf()
- {
- FILE=/etc/inetd.conf
- TMPFILE=/tmp/inetd.conf
- XCOMM
- XCOMM check for existence of /etc/inetd.conf
- XCOMM
- if [ ! -f $FILE ] # highly unlikely
- then
- echo "" >$FILE
- fi
- XCOMM
- XCOMM see if it already exists
- XCOMM
- awk '{if ($1 == "dtspc")
- print $0 > "/tmp/dtspc-already-there"
- }' $FILE >/dev/null
- DTSPCD=CDE_INSTALLATION_TOP/bin/dtspcd
- if [ ! -f /tmp/dtspc-already-there ]
- then
- echo "dtspc stream tcp nowait root $DTSPCD $DTSPCD" >>$FILE
- else
- rm /tmp/dtspc-already-there
- fi
- XCOMM
- XCOMM remove legacy entries like dtspcd
- XCOMM
- awk '{if ($1 == "dtspcd" || $1 == "#dtspcd")
- ;
- else
- print $0
- }' $FILE >$TMPFILE
- cp $TMPFILE $FILE
- rm $TMPFILE
- }
- UnfixEtcInetdDotConf()
- {
- FILE=/etc/inetd.conf
- TMPFILE=/tmp/inetd.conf
- awk '{if ($1 == "dtspc")
- ;
- else
- print $0
- }' $FILE >$TMPFILE
- cp $TMPFILE $FILE
- rm $TMPFILE
- }
- FixEtcPamDotConf()
- {
- FILE=/etc/pam.conf
- ORIGFILE=/etc/pam.conf.preCDE
- XCOMM
- XCOMM check for existence of /etc/pam.conf
- XCOMM
- if [ -f $FILE ]
- then
- echo "" > $ORIGFILE
- cp CDE_INSTALLATION_TOP/config/sys.pam.conf $FILE
- chmod 644 $FILE
- else
- echo "Warning: $FILE already exists. Leaving it alone." 1>&2
- cp CDE_INSTALLATION_TOP/config/sys.pam.conf $ORIGFILE
- fi
- }
- UnfixEtcPamDotConf()
- {
- FILE=/etc/pam.conf
- TMPFILE=/etc/pam.conf.CDE
- ORIGFILE=/etc/pam.conf.preCDE
- if [ ! -f $FILE ]
- then
- echo "Warning: $FILE does not exist." 1>&2
- elif [ ! -f $ORIGFILE ]
- then
- echo "Warning: $ORIGFILE does not exist. Leaving $FILE alone." 1>&2
- else
- mv $FILE $TMPFILE
- cp $ORIGFILE $FILE
- chmod 664 $FILE
- fi
- }
- RemoveMinFiles()
- {
- while read SRC
- do
- if [ "$SRC" != "" ]
- then
- rm -f $SRC
- dirname=${SRC%/STAR}
- if [ -d $dirname ]
- then
- cd $dirname
- while [ "$dirname" != "$CDE_TOP" ]
- do
- cd ..
- rmdir ${dirname##STAR/} >/dev/null 2>/dev/null
- dirname=${dirname%/STAR}
- done
- fi
- fi
- done <<-EOF
- #include "CDE-MIN.list"
- EOF
- }
- VerifyInstalledFiles()
- {
- echo "Status mode owner group filename"
- echo "-----------------------------------------"
- XCOMM exists correct correct correct /usr/dt/foo1
- XCOMM MISSING WRONG WRONG WRONG /usr/dt/foo2
- XCOMM exists the link is correct /usr/dt/link
- while read SRC
- do
- #include "../verify.func"
- done <<-EOF
- #include "CDE-MIN.lst"
- EOF
- }
- #include "../option.func"
- XCOMM ###############################################################
- XCOMM
- XCOMM Main Body
- XCOMM
- XCOMM ###############################################################
- HandleOption $*
- if [ "$OPERATION" = "configure" ]
- then
- FixEtcServices
- FixEtcInetdDotConf
- HASH FixEtcPamDotConf
- HASH
- HASH create the /var/dt/tmp directory for the dtspcd
- HASH
- if [ ! -d CDE_LOGFILES_TOP/tmp ]
- then
- mkdir -p CDE_LOGFILES_TOP/tmp
- fi
- elif [ "$OPERATION" = "deconfigure" ]
- then
- UnfixEtcServices
- UnfixEtcInetdDotConf
- UnfixEtcPamDotConf
- RemoveMinFiles
- VerifyInstalledFiles
- elif [ "$OPERATION" = "verify" ]
- then
- VerifyInstalledFiles
- fi
- if [ "$OPERATION" != "verify" ]
- then
- HASH issue a SIGHUP to the inetd process
- ps -ef | grep inetd | grep -v grep >/tmp/tmppsout
- if [ -s /tmp/tmppsout ]
- then
- awk '{print "kill -1 " $2}' /tmp/tmppsout | /bin/sh
- else
- [ -x /usr/sbin/inetd ] && /usr/sbin/inetd
- fi
- fi
- return $retval
|