2 XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
3 XCOMM @(#) $XConsortium: configTT.src /main/5 1996/04/23 10:36:05 drk $
5 XCOMM AIX cpp does not honor the usual requirement that preprocessor
6 XCOMM directives must begin in column one, so we must do more quoting.
14 grep "ttdbserverd" $INETD > /dev/null 2>&1 && sed "/ttdbserverd/d" $INETD > /tmp/configTT.$$ && mv /tmp/configTT.$$ $INETD
15 rc=`grep "ttdbserver" $INETD | cut -c1 | grep -xv "#" \
16 1>/dev/null 2>/dev/null;echo $?`
18 rc=`inetserv -s -I -v ttdbserver -p tcp 1>/dev/null 2>/dev/null;echo $?`
26 XCOMM Checks if portmap daemon is already running; if not
27 XCOMM starts the portmap daemon.
31 ps -ef | fgrep portmap | grep -v grep 2>/dev/null 1>/dev/null
39 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
40 if [ -s /tmp/tmppsout ]
42 awk '{print "kill " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
44 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
45 if [ -s /tmp/tmppsout ]
47 awk '{print "kill -TERM " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
49 ps -ef | fgrep $1 | grep -v grep >/tmp/tmppsout
50 if [ -s /tmp/tmppsout ]
52 awk '{print "kill -9 " $2}' /tmp/tmppsout | /bin/ksh 1>/dev/null
63 XCOMM now check to see if the proper entry is in /etc/rpc
71 HASH if the file doesn't exist (highly unlikely), make one
72 HASH with the proper entry
75 echo "ttdbserver 100083 tooltalk" >$RPCFILE
79 HASH check to see if the entry is already there
81 grep "ttdbserverd" $RPCFILE > /dev/null 2>&1 && sed "/ttdbserverd/d" $RPCFILE > /tmp/configTTrpc.$$ && mv /tmp/configTTrpc.$$ $RPCFILE
83 awk '{if ($1 == "ttdbserver" && $2 == "100083")
84 print $0 > "/tmp/etc-rpc-already-there"
85 }' $RPCFILE >/dev/null
87 if [ ! -f /tmp/etc-rpc-already-there ]
90 HASH if it isn't, check to see if either term already
91 HASH exists. If either one does they need to be commented
94 awk '{if (($1 == "ttdbserver" && $2 != "100083") ||
95 ($2 == "100083" && $1 != "ttdbserver"))
101 echo "ttdbserver 100083 tooltalk" >>$TMPFILE
105 rm /tmp/etc-rpc-already-there
113 TMPFILE="/tmp/etc-rpc"
115 awk '{if ($1 == "ttdbserver" && $2 == "100083")
117 else if ($1 == "ttdbserverd" && $2 == "100083")
125 awk '{if ($1 == "#cde") {
135 RemovettFromInetserv()
137 TTDB=CDE_INSTALLATION_TOP/bin/rpc.ttdbserver
140 /usr/sbin/chsubserver -d -v ttdbserver -t sunrpc_tcp -p tcp -w wait -u root \
141 -g $TTDB -r inetd rpc.ttdbserver 100083 1 \
142 1>/dev/null 2>/dev/null
143 grep -v "#ttdbserver" $INETD >/tmp/configTT.$$ && cp /tmp/configTT.$$ $INETD
147 inetserv -D -I -v ttdbserver -p tcp 2>/dev/null 1>/dev/null
160 INETD=/etc/inetd.conf
161 TTDB=CDE_INSTALLATION_TOP/bin/rpc.ttdbserver
164 XCOMM check for existence of /etc/inetd.conf
167 if [ ! -f $INETD ] # highly unlikely
175 /usr/sbin/chsubserver -a -v ttdbserver -t sunrpc_tcp -p tcp -w wait -u root \
176 -g $TTDB -r inetd rpc.ttdbserver 100083 1 \
177 1>/dev/null 2>/dev/null
186 XCOMM Check if the server exists in the /etc/inetd.conf file.
188 rc=`inetserv -s -I -v ttdbserver -p tcp 1>/dev/null 2>/dev/null;echo $?`
192 inetserv -a -S -v ttdbserver -p tcp -n 111
196 inetserv -a -I -v ttdbserver -p tcp -t sunrpc_tcp -w wait -U root \
197 -r $TTDB -R "rpc.ttdbserver 100083 1"
203 echo "Cannot add entries to inetd.conf..."
213 while [ $# -ne 0 ]; do
215 -e) DO_CONFIGURATION="yes"
218 -d) DO_CONFIGURATION="no"
225 XCOMM ##################################################################
229 XCOMM ##################################################################
236 StopDaemon "rpc.ttdbserver"
241 if [ "$DO_CONFIGURATION" = "yes" ]
259 elif [ "$DO_CONFIGURATION" = "no" ]
274 echo "\nToolTalk is already disabled..\n"
281 if [ "$DO_CONFIGURATION" != "" ]
284 XCOMM After adding ToolTalk to the inetd service list the inet
285 XCOMM daemon needs to reread its configuration.