1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

NetBSD port

This commit is contained in:
Ulrich Wilkens 2014-02-20 19:19:17 +01:00 committed by Jon Trulson
parent a4f9413950
commit 2712d5f787
94 changed files with 2443 additions and 302 deletions

View file

@ -216,6 +216,14 @@ CleanDaemons()
sleep 2
fi
elif [ "$PLATFORM" = "freebsd" ]
then
ps axo pid,comm | grep $i > /tmp/tmppsout
if [ -s /tmp/tmppsout ]
then
awk '{print "kill " $1}' /tmp/tmppsout | /bin/csh -f
sleep 2
fi
elif [ "$PLATFORM" = "netbsd" ]
then
ps axo pid,comm | grep $i > /tmp/tmppsout
if [ -s /tmp/tmppsout ]
@ -264,6 +272,9 @@ RestartInetd()
elif [ "$PLATFORM" = "freebsd" ]
then
/etc/rc.d/inetd onestart
elif [ "$PLATFORM" = "netbsd" ]
then
/etc/rc.d/inetd start >/dev/null
elif [ "$PLATFORM" = "linux" ]
then
/etc/init.d/openbsd-inetd start >/dev/null 2>&1
@ -578,6 +589,10 @@ XCOMM
then
PLATFORM="openbsd"
PLATFORM_SCRIPT_DIR="openbsd"
elif [ $BUILDSYSTEM = "NetBSD" ];
then
PLATFORM="netbsd"
PLATFORM_SCRIPT_DIR="netbsd"
else # Build system = HP
PLATFORM=hp-ux
PLATFORM_SCRIPT_DIR=hp

View file

@ -8,11 +8,11 @@ export SYSTYPE=bsd4.3
# where it is not necessary to run nroff on the man page sources.
# Put "/etc" in the path
# Put "/etc", "/sbin" and "/usr/sbin" in the path
# because this is where "chown" appears on bsd4.3 systems (i.e. apollo).
# Put "/usr/apollo/bin" on the path to access "chacl" on apollo systems.
export PATH=":/etc:$PATH:/usr/apollo/bin:"
export PATH=":/etc:/sbin:/usr/sbin:$PATH:/usr/apollo/bin:"
typeset STRIP=""

View file

@ -24,6 +24,10 @@ SUBDIRS = linux
PLATFORM = openbsd
SUBDIRS = openbsd
#endif
#ifdef NetBSDArchitecture
PLATFORM = netbsd
SUBDIRS = netbsd
#endif
#ifdef FreeBSDArchitecture
PLATFORM = freebsd
SUBDIRS = freebsd

View file

@ -281,7 +281,7 @@ DEFAULT_PRINTER="DtPrint"
HASH
HASH ConfigurePrintersDir
HASH
env LANG=C /usr/dt/bin/dtprintinfo -populate
HASH env LANG=C /usr/dt/bin/dtprintinfo -populate
HASH
HASH Configure Xsession.d

View file

@ -0,0 +1,71 @@
XCOMM $TOG: Imakefile /main/1 1998/03/11 16:08:16 mgreess $
TOOL_DIR = ../../dbTools
DATABASE_DIR = ../../../../databases
#ifdef HPArchitecture
PLATFORM = hp-ux
#endif
#ifdef LinuxArchitecture
PLATFORM = linux
#endif
#ifdef FreeBSDArchitecture
PLATFORM = freebsd
#endif
#ifdef OpenBSDArchitecture
PLATFORM = openbsd
#endif
#ifdef NetBSDArchitecture
PLATFORM = netbsd
#endif
#ifdef RsArchitecture
PLATFORM = aix
#endif
#ifdef SunArchitecture
PLATFORM = sun
.NO_PARALLEL:
#endif
#ifdef USLArchitecture
PLATFORM = usl
#endif
#ifdef UXPArchitecture
PLATFORM = uxp
#endif
UDBTOANY = $(KORNSHELL) $(TOOL_DIR)/udbToAny.ksh
BUILD_UDB_LIST = $(SHELL) ../build_udb_list
all::
configMin:: $(DATABASE_DIR)/CDE-MIN.udb
$(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
$(DATABASE_DIR)/CDE-MIN.udb > CDE-MIN.lst
$(BUILD_UDB_LIST) CDE-MIN ../../../..
configTT:: $(DATABASE_DIR)/CDE-TT.udb
$(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
$(DATABASE_DIR)/CDE-TT.udb > CDE-TT.lst
$(BUILD_UDB_LIST) CDE-TT ../../../..
configRun:: $(DATABASE_DIR)/CDE-RUN.udb
$(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
$(DATABASE_DIR)/CDE-RUN.udb > CDE-RUN.lst
$(BUILD_UDB_LIST) CDE-RUN ../../../..
configShlibs:: $(DATABASE_DIR)/CDE-SHLIBS.udb
$(UDBTOANY) -toLst -ReleaseStream $(PLATFORM) \
$(DATABASE_DIR)/CDE-SHLIBS.udb > CDE-SHLIBS.lst
$(BUILD_UDB_LIST) CDE-SHLIBS ../../../..
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
-DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)
AllTarget(configShlibs configTT configRun configMin)
CppScriptTarget(configShlibs,configShlibs.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(configTT,configTT.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(configRun,configRun.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(configMin,configMin.src,$(LOCAL_CPP_DEFINES),)
clean::
$(RM) *.lst *.list

View file

@ -0,0 +1,257 @@
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
printf "dtspc\t\t6112/tcp\t\t# subprocess control\n" >>$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
printf "dtspc\t\tstream\ttcp nowait\troot\t$DTSPCD $DTSPCD\n" >>$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
HASH create the CDE_LOGFILES_TOP/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
RemoveMinFiles
VerifyInstalledFiles
elif [ "$OPERATION" = "verify" ]
then
VerifyInstalledFiles
fi
return $retval

View file

@ -0,0 +1,416 @@
XCOMM! /bin/ksh
XCOMM #######
XCOMM Product: CDE
XCOMM Fileset: CDE-RUN
XCOMM configure
XCOMM @(#) $TOG: configRun.src /main/1 1998/03/11 16:18:24 mgreess $
XCOMM #######
#define HASH #
#define STAR *
PRODUCT=CDE
FILESET=CDE-RUN
DO_CONFIGURATION=""
retval=0
FixInetdDotConf()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
XCOMM
XCOMM desired inetd.conf entry:
XCOMM cmsd/2-4 dgram rpc/udp wait root CDE_INSTALLATION_TOP/bin/rpc.cmsd rpc.cmsd
XCOMM
XCOMM first make an awk script and put it in a file.
XCOMM
XCOMM comment out any non-cde rpc.cmsd lines
XCOMM
awk -v cmsd=$CMSD \
'{if ($1 == "cmsd/2-4" && $6 != cmsd)
print "#cde " $0;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM remove any cde 2-4 cmsd
XCOMM
awk -v cmsd=$CMSD \
'{if ($1 == "cmsd/2-4" && $6 == cmsd)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
XCOMM
XCOMM now run an awk script to see if there is an occurrence of 2-5 cmsd
XCOMM
awk -v cmsd=$CMSD \
'{if ($6 == cmsd && $1 == "cmsd/2-5")
print $0 > "/tmp/cmsd-already-there"
}' $FILE >/dev/null
XCOMM
XCOMM if it is not there, add it
XCOMM
if [ ! -f /tmp/cmsd-already-there ]
then
printf "cmsd/2-5\tdgram\trpc/udp wait\troot\t$CMSD rpc.cmsd\n" >>$FILE
else
rm /tmp/cmsd-already-there
fi
}
UnfixInetdDotConf()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
CMSD=CDE_INSTALLATION_TOP/bin/rpc.cmsd
HASH first remove the CDE rpc.cmsd entry
awk -v cmsd=$CMSD \
'{if (($1 == "cmsd/2-4" || $1 == "cmsd/2-5") && $6 == cmsd)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
HASH now uncomment any previously existing cmsd entry
awk '{if ($1 == "#cde") {
if ($2 == "cmsd/2-4") {
$1 = $2;
$2 = ""
}
}
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
}
FixEtcRpc()
{
XCOMM
XCOMM now check to see if the proper entry is in /etc/rpc
XCOMM
RPCFILE=/etc/rpc
TMPFILE=/tmp/etc-rpc
if [ ! -f $RPCFILE ]
then
HASH if the file doesn't exist (highly unlikely), make one
HASH with the proper entry
HASH
printf "cmsd\t\t100068\tdtcalendar\n" >$RPCFILE
else
HASH
HASH check to see if the entry is already there
HASH
awk '{if ($1 == "cmsd" && $2 == "100068")
print $0 > "/tmp/etc-rpc-already-there"
}' $RPCFILE >/dev/null
if [ ! -f /tmp/etc-rpc-already-there ]
then
HASH
HASH if it isn't, check to see if either term already
HASH exists
HASH
awk '{if ($1 == "cmsd" || $2 == "100068")
print $0 > "/tmp/etc-rpc-already-there"
}' $RPCFILE >/dev/null
HASH
HASH if either one does they need to be commented out
HASH
if [ ! -f /tmp/etc-rpc-already-there ]
then
printf "cmsd\t\t100068\tdtcalendar\n" >>$RPCFILE
else
awk '{if ($1 == "cmsd" || $2 == "100068")
print "#cde " $0;
else
print $0
}' $RPCFILE >$TMPFILE
printf "cmsd\t\t100068\tdtcalendar\n" >>$TMPFILE
mv $TMPFILE $RPCFILE
rm /tmp/etc-rpc-already-there
fi
else
rm /tmp/etc-rpc-already-there
fi
fi
}
UnfixEtcRpc()
{
FILE="/etc/rpc"
TMPFILE="/tmp/etc-rpc"
awk '{if ($1 == "cmsd" && $2 == "100068")
;
else
print $0
}' $FILE >$TMPFILE
mv $TMPFILE $FILE
awk '{if ($1 == "#cde" && ($2 == "cmsd" || $3 == "100068"))
;
else
print $0
}' $FILE >$TMPFILE
mv $TMPFILE $FILE
}
CreateAppConfigDirectory()
{
HASH
HASH Create the APPCONFIG directory inside DT_CONFIG_TOP and create
HASH all of its subdirectories
HASH
cd $DT_CONFIG_TOP
if [ ! -d $APPCONFIG ]
then
mkdir $APPCONFIG
fi
cd $APPCONFIG
for i in $APPCONFIG_DIRS
do
if [ ! -d $i ]
then
mkdir $i
fi
cd $i
HASH
HASH for each locale
HASH
for j in $DT_TOP/$APPCONFIG/$i/STAR
do
if [ ! -d `basename $j` ]
then
mkdir `basename $j`
fi
done
cd ..
done
}
doDttermTerminfo()
{
if [ -f $DT_TOP/config/dtterm.ti ]
then
tic $DT_TOP/config/dtterm.ti
else
echo "Unable to find $DT_TOP/config/dtterm.ti"
fi
}
RemoveRunFiles()
{
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-RUN.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-RUN.lst"
EOF
}
PrintUsage()
{
echo "Usage:" $0 "[OPERATION]"
echo ""
echo "Operations:"
echo " -e configure"
echo " -d deconfigure"
echo " -v verify"
echo " -s size"
echo " -h help"
}
#include "../option.func"
XCOMM ##########################################################################
XCOMM
XCOMM Main Body
XCOMM
XCOMM ##########################################################################
PRODUCT=CDE
FILESET=CDE-RUN
DT_TOP=CDE_INSTALLATION_TOP
DT_CONFIG_TOP=CDE_CONFIGURATION_TOP
DT_TEMP_TOP=CDE_LOGFILES_TOP
ROOT=/
retval=0
APPCONFIG=appconfig
APPCONFIG_DIRS="appmanager help icons types"
PRINTERS=""
DEFAULT_PRINTER="DtPrint"
HandleOption $*
if [ "$OPERATION" = "usage" ]
then
PrintUsage
exit 0
fi
if [ "$OPERATION" = "configure" ]
then
HASH
HASH create the CDE_LOGFILES_TOP directory
HASH
if [ ! -d $DT_TEMP_TOP/$APPCONFIG/appmanager ]
then
mkdir -p $DT_TEMP_TOP/$APPCONFIG/appmanager
fi
cd $DT_TEMP_TOP
mv $APPCONFIG/appmanager .hidden-appmanager
chmod -R 755 *
chmod 755 .hidden-appmanager
/usr/sbin/chown -R bin *
/usr/bin/chgrp -R bin *
mv .hidden-appmanager $APPCONFIG/appmanager
chmod 755 .
/usr/sbin/chown bin .
/usr/bin/chgrp bin .
HASH
HASH create the CDE_CONFIGURATION_TOP and its config directory
HASH
if [ ! -d $DT_CONFIG_TOP ]
then
mkdir -p $DT_CONFIG_TOP
fi
if [ ! -d $DT_CONFIG_TOP/config ]
then
mkdir -p $DT_CONFIG_TOP/config
fi
CreateAppConfigDirectory
HASH
HASH ConfigurePrintersDir
HASH
HASH env LANG=C /usr/dt/bin/dtprintinfo -populate
HASH
HASH Configure Xsession.d
HASH
cd $DT_CONFIG_TOP/config
if [ ! -d Xsession.d ]
then
mkdir Xsession.d
fi
cd $DT_CONFIG_TOP
chmod -R 755 *
FixInetdDotConf
FixEtcRpc
elif [ "$OPERATION" = "deconfigure" ]
then
UnfixEtcRpc
UnfixInetdDotConf
RemoveRunFiles
VerifyInstalledFiles
elif [ "$OPERATION" = "verify" ]
then
VerifyInstalledFiles
fi
if [ "$OPERATION" != "verify" ]
then
HASH issue a SIGHUP to the inetd process
/etc/rc.d/inetd reload >/dev/null
fi
HASH dtmail requires setgid
chmod 2555 $DT_TOP/bin/dtmail
return $retval

View file

@ -0,0 +1,105 @@
XCOMM!/bin/ksh
XCOMM $TOG: configShlibs.src /main/1 1998/03/11 16:18:33 mgreess $
#define STAR *
XCOMM ############################################
RemoveShlibFiles()
{
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-SHLIBS.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-SHLIBS.lst"
EOF
}
#include "../option.func"
MakeTheLink()
{
XCOMM
XCOMM Usage: configTT
XCOMM
XCOMM creates links in the install tree libtt.so -> libtt.so.1
XCOMM
cd CDE_INSTALLATION_TOP/lib
for lib in `/bin/ls *.so.*`
do
link=`echo $lib | cut -d. -f1,2`
rm -f $link
ln -s $lib $link
done
}
XCOMM #########################################################################
XCOMM
XCOMM Main Body
XCOMM
XCOMM #########################################################################
PRODUCT=CDE
FILESET=CDE-SHLIBS
retval=0
CDE_TOP=CDE_INSTALLATION_TOP
CDE_CONF_TOP=CDE_CONFIGURATION_TOP
HandleOption $*
if [ "$OPERATION" = "deconfigure" ]
then
echo "de-Configuring for CDE-SHLIBS..."
RemoveShlibFiles
VerifyInstalledFiles
elif [ "$OPERATION" = "configure" ]
then
MakeTheLink
elif [ "$OPERATION" = "verify" ]
then
VerifyInstalledFiles
fi
return $retval

View file

@ -0,0 +1,214 @@
XCOMM! /bin/ksh
XCOMM #######
XCOMM Product: CDE
XCOMM Fileset: CDE-TT
XCOMM configure
XCOMM @(#) $TOG: configTT.src /main/1 1998/03/11 16:18:40 mgreess $
XCOMM #######
XCOMM
XCOMM (c) Copyright Hewlett-Packard Company, 1993
XCOMM
XCOMM #######
#define HASH #
PRODUCT=CDE
FILESET=CDE-TT
DO_CONFIGURATION=""
retval=0
FixInetdDotConf()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
TTDBSERVERD=CDE_INSTALLATION_TOP/bin/rpc.ttdbserver
XCOMM
XCOMM see if it already exists
XCOMM
awk -v ttdb=$TTDBSERVERD \
'{if ($1 == "ttdbserver/1" && $6 != ttdb)
print "#cde " $0;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
awk '{if ($1 == "ttdbserver/1")
print $0 > "/tmp/tt-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/tt-already-there ]
then
printf "ttdbserver/1\tstream\trpc/tcp wait\troot\t$TTDBSERVERD $TTDBSERVERD\n" >>$FILE
else
rm /tmp/tt-already-there
fi
}
UnfixInetdDotConf()
{
FILE=/etc/inetd.conf
TMPFILE=/tmp/inetd.conf
TTDBSERVERD=CDE_INSTALLATION_TOP/bin/rpc.ttdbserver
awk -v ttdb=$TTDBSERVERD \
'{if ($1 == "ttdbserver/1" && $6 == ttdb)
;
else
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
awk '{if ($1 == "#cde" && ($2 == "ttdbserver/1" || $2 == "ttdbserver")) {
$1 = $2;
$2 = ""
}
print $0
}' $FILE >$TMPFILE
cp $TMPFILE $FILE
rm $TMPFILE
}
FixEtcRpc()
{
FILE=/etc/rpc
TMPFILE=/tmp/etc-rpc
if [ ! -f $FILE ]
then
printf "ttdbserver\t100083\ttooltalk\n" >$FILE
else
awk '{if ($1 == "ttdbserver" && $2 == "100083")
print $0 > "/tmp/etc-rpc-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/etc-rpc-already-there ]
then
awk '{if ($1 == "ttdbserver" || $2 == "100083")
print $0 > "/tmp/etc-rpc-already-there"
}' $FILE >/dev/null
if [ ! -f /tmp/etc-rpc-already-there ]
then
printf "ttdbserver\t100083\ttooltalk\n" >>$FILE
else
awk '{if ($1 == "ttdbserver" || $2 == "100083")
print "#cde " $0; else print $0
}' $FILE >$TMPFILE
printf "ttdbserver\t100083\ttooltalk\n" >>$TMPFILE
mv $TMPFILE $FILE
rm /tmp/etc-rpc-already-there
fi
else
rm /tmp/etc-rpc-already-there
fi
fi
}
UnfixEtcRpc()
{
FILE="/etc/rpc"
TMPFILE="/tmp/etc-rpc"
awk '{if ($1 == "ttdbserver" && $2 == "100083")
;
else
print $0
}' $FILE >$TMPFILE
mv $TMPFILE $FILE
awk '{if ($1 == "#cde") {
$1 = $2;
$2 = ""
}
print $0
}' $FILE >$TMPFILE
mv $TMPFILE $FILE
}
RemoveTTFiles()
{
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-TT.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-TT.lst"
EOF
}
#include "../option.func"
XCOMM ######################################################################
XCOMM
XCOMM Main Body
XCOMM
XCOMM ######################################################################
HandleOption $*
if [ "$OPERATION" = "configure" ]
then
FixInetdDotConf
FixEtcRpc
elif [ "$OPERATION" = "deconfigure" ]
then
UnfixEtcRpc
UnfixInetdDotConf
RemoveTTFiles
VerifyInstalledFiles
elif [ "$OPERATION" = "verify" ]
then
VerifyInstalledFiles
fi
return $retval