home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SunSoft Catalyst 1995 September to December
/
CDware_Sep-Dec_1995.bin
/
cdware
Wrap
Text File
|
1995-10-26
|
10KB
|
369 lines
#!/bin/sh
#
# The following CDware script launches httpd, waissearch, and hotjava
# on Solaris SPARC, Solaris x86, and SunOS
# Author: Marc Sacoolas (marc.sacoolas@sun.com)
# Date: April 4, 1995
# initialize variables
dir_exist=0
echo ""
echo " Catalyst CDware initializing ..."
echo ""
# set CDMOUNT to path from the command line arguements
CDMOUNT=`expr \
$0'/' : '\(/\)[^/]*//*$' \
\| $0'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \
\| .`
# if command line path is current directory then set CDMOUNT to pwd
# CDMOUNT cannot be set to . because other programs/scripts
# need the absolute path in CD_MOUNT
if [ "$CDMOUNT" = "." ]; then
CDMOUNT=`pwd`
fi
CD_MOUNT=$CDMOUNT
export CD_MOUNT
#
# os type and arch
#
check_os()
{
os_ver="`/bin/uname -r | /bin/grep 5\[.]`"
export os_ver
if [ -n "$os_ver" ]; then
# must be running Solaris 2.x
machine_type="`/bin/uname -m`"
os_type="`/bin/uname -r`"
if [ "$machine_type" = "i86pc" ]; then
OS_TYPE=""
GUI=.products/bin/Solaris_2_x86/Prism/prism
GUI_BIN=prism
CDWARE_ENV=Solaris_x86
else
# must be on a SPARCarchitecture-based machine
bcp="`/bin/pkginfo | /bin/grep SUNWbcp`"
if [ "$GUI_BIN" = "cdmgr" ]; then
GUI=.products/bin/Solaris_2/cdmanager
else
GUI=.products/bin/Solaris_2/Prism/prism
fi
# check for bcp and set CDWARE_ENV accordingly???
CDWARE_ENV=Solaris_2
fi
else
# must be running Solaris 1.x
GUI=.products/bin/Solaris_1/cdmanager
GUI_BIN=cdmgr
CDWARE_ENV=Solaris_1
fi
#
# CDWARE_HOME used by screendemo, slidecacher, and seaudio
#
CDWARE_HOME=$CDMOUNT/.products/bin/$CDWARE_ENV$OS_TYPE
export GUI CDWARE_ENV CDWARE_HOME OS_TYPE
}
# print out legal text as required by the lawyers
echo " "
cat $CD_MOUNT/.products/CDware/legal.txt
check_os
#
# If runs on SunOS, display the warning window
#
if [ "$CDWARE_ENV" = "Solaris_1" ]; then
$CD_MOUNT/.products/.bin/httpd/$CDWARE_ENV/warning
if [ "$?" = "1" ]; then
echo "Exiting ..."
exit
fi
fi
# set the path hotjava looks for its extended browser classes
if [ "$CDWARE_ENV" = "Solaris_1" ]; then
XNLSPATH=$CD_MOUNT/.products/hotjava/Solaris_1/usr/local/X11R5/lib/X11/nls
export XNLSPATH
fi
export LD_LIBRARY_PATH HOTJAVA_HOME CLASSPATH PATH
LD_LIBRARY_PATH=$CD_MOUNT/.products/hotjava/$CDWARE_ENV/lib:/usr/openwin/lib:/usr/slib:/usr/lib
HOTJAVA_HOME=$CD_MOUNT/.products/hotjava
CLASSPATH=$CD_MOUNT/.products/hotjava/classes:$CD_MOUNT/.products/CDware/classes
if [ "$CDWARE_ENV" = "Solaris_1" ]; then
PATH=$PATH:$CD_MOUNT/.products/hotjava/$CDWARE_ENV/bin:/tmp/httpd/.cgi-bin:/usr/ucb:/usr/bin:/usr/sbin
else
PATH=$PATH:$CD_MOUNT/.products/hotjava/$CDWARE_ENV/bin:/tmp/httpd/.cgi-bin:/usr/bin:/usr/sbin
fi
# play welcome audio clip
if [ $CDWARE_ENV != "Solaris_1" ]; then
audioplay -i $CD_MOUNT/.products/CDware/sounds/welcome.au&
else
cat $CD_MOUNT/.products/CDware/sounds/welcome.au > /dev/audio&
fi
# set the dir where all the companies live
PRODUCT_DIR=$CD_MOUNT/.products
export PRODUCT_DIR
#WWW_HOME=$CDMOUNT/.products/CDware/
#export WWW_HOME
# if "/tmp/.wais" symlink is not already there, then
# create link for wais-src and wais on CDrom
if [ ! -h /tmp/.wais ]; then
ln -s $PRODUCT_DIR/.wais /tmp
fi
# move only needed files and symlink for "file" URLs, if necessary
if [ ! -d /tmp/httpd ]; then
mkdir /tmp/httpd
mkdir /tmp/httpd/bin
mkdir /tmp/httpd/conf
cp -r $CD_MOUNT/.products/.bin/httpd/conf /tmp/httpd&
cp -r $CD_MOUNT/.products/.bin/httpd/logs /tmp/httpd&
ln -s $PRODUCT_DIR /tmp/httpd
fi
# check for mailcap file
if [ -r $HOME/.mailcap ]; then
cp $HOME/.mailcap $HOME/.mailcap.cdware
echo "application/x-spam-sh; /bin/sh %s " >> $HOME/.mailcap
else
echo "application/x-spam-sh; /bin/sh %s " > $HOME/.mailcap
fi
# needed srm.conf doc for httpd conf
echo ""
echo " NCSA World Wide Web server initializing ..."
echo ""
echo " Portions developed at the National Center"
echo " for Supercomputing Applications at the"
echo " University of Illinois at Urbana-Champaign."
echo ""
if [ ! -h /tmp/httpd/.cgi-bin ]; then
ln -s $PRODUCT_DIR/.bin/httpd/$CDWARE_ENV /tmp/httpd/.cgi-bin
fi
wais_conf()
{
echo "DocumentRoot $CD_MOUNT/.products" >> /tmp/httpd/conf/srm.conf
echo 'UserDir public_html' >> /tmp/httpd/conf/srm.conf
echo 'DirectoryIndex index.html' >> /tmp/httpd/conf/srm.conf
echo 'FancyIndexing on' >> /tmp/httpd/conf/srm.conf
echo 'AddType application/x-spam-sh .sh' >> /tmp/httpd/conf/srm.conf
echo 'AddIconByType (TXT,/icons/text.xbm) text/*' >> /tmp/httpd/conf/srm.conf
echo 'AddIconByType (IMG,/icons/image.xbm) image/*' >> /tmp/httpd/conf/srm.conf
echo 'AddIconByType (SND,/icons/sound.xbm) audio/*' >> /tmp/httpd/conf/srm.conf
echo 'AddIcon /icons/movie.xbm .mpg .qt' >> /tmp/httpd/conf/srm.conf
echo 'AddIcon /icons/binary.xbm .bin' >> /tmp/httpd/conf/srm.conf
echo 'AddIcon /icons/back.xbm ..' >> /tmp/httpd/conf/srm.conf
echo 'AddIcon /icons/menu.xbm ^^DIRECTORY^^' >> /tmp/httpd/conf/srm.conf
echo 'AddIcon /icons/blank.xbm ^^BLANKICON^^' >> /tmp/httpd/conf/srm.conf
echo 'DefaultIcon /icons/unknown.xbm' >> /tmp/httpd/conf/srm.conf
echo 'ReadmeName README' >> /tmp/httpd/conf/srm.conf
echo 'HeaderName HEADER' >> /tmp/httpd/conf/srm.conf
echo 'IndexIgnore */.??* *~ *# */HEADER* */README*' >> /tmp/httpd/conf/srm.conf
echo 'AccessFileName .htaccess' >> /tmp/httpd/conf/srm.conf
echo 'DefaultType text/plain' >> /tmp/httpd/conf/srm.conf
echo "Alias /icons/ $CD_MOUNT/.products/.bin/httpd/icons/" >> /tmp/httpd/conf/srm.conf
echo "Alias http:/ $CD_MOUNT/.products/.bin/httpd/cache_root/" >> /tmp/httpd/conf/srm.conf
echo "Alias /localhost:8001/ /$hostname:8001/" >> /tmp/httpd/conf/srm.conf
echo "ScriptAlias /cgi-bin/ $CD_MOUNT/.products/.bin/httpd/cgi-bin/" >> /tmp/httpd/conf/srm.conf
echo "ScriptAlias /run/ $CD_MOUNT/.products/" >> /tmp/httpd/conf/srm.conf
# generate access.conf file
echo '<Directory /tmp/httpd/>' >> /tmp/httpd/conf/access.conf
echo 'Options Indexes FollowSymLinks' >> /tmp/httpd/conf/access.conf
echo '</Directory>' >> /tmp/httpd/conf/access.conf
echo "<Directory $CD_MOUNT/.products/*>" >> /tmp/httpd/conf/access.conf
echo 'Options Indexes FollowSymLinks ExecCGI' >> /tmp/httpd/conf/access.conf
echo 'AllowOverride All' >> /tmp/httpd/conf/access.conf
echo '<Limit GET>' >> /tmp/httpd/conf/access.conf
echo 'order allow,deny' >> /tmp/httpd/conf/access.conf
echo 'allow from all' >> /tmp/httpd/conf/access.conf
echo '</Limit>' >> /tmp/httpd/conf/access.conf
echo '</Directory>' >> /tmp/httpd/conf/access.conf
# generate imagemap.conf
#echo " : " > /tmp/httpd/conf/imagemap.conf
# make link to *real* cgi-bin dirctory
# Check to see if the user is root, if so, change to
# "-nobody"
#
USER=`/usr/ucb/whoami`
if [ "$USER" = "root" ]; then
echo "User nobody" >>/tmp/httpd/conf/httpd.conf-dist
echo "Group nobody" >>/tmp/httpd/conf/httpd.conf-dist
fi
#launch httpd
$CD_MOUNT/.products/.bin/httpd/cgi-bin/httpd -f /tmp/httpd/conf/httpd.conf-dist
}
wais_conf&
# launch wais search deamen
echo " Launching Catalyst Catalog WAIS server ..."
echo ""
echo " Copyright (c) MCNC, Clearinghouse for Networked"
echo " Information Discovery and Retrieval, 1993."
$CD_MOUNT/.products/.bin/httpd/cgi-bin/waisserver -p 7998 -d $CD_MOUNT/.products/.wais/wais >/tmp/waisserver.log 2>&1 &
pid=$!
# launch hotJAVA
# place .hotjava in home to void initial pop-up window
echo " Launching HotJava browser ..."
echo ""
echo " Catalyst CDware demos and trial software"
echo " as well as the World Wide Web are brought"
echo " to you through HotJava."
echo ""
echo " NOTE: If you have internet access through"
echo " a fire-wall, you may have to set a \"proxy\""
echo " server under \"options\" in HotJava."
if [ -d $HOME/.hotjava ]; then
mv $HOME/.hotjava $HOME/.hotjava.cdware
cp -r $CD_MOUNT/.products/hotjava/.hotjava $HOME
dir_exist=1
else
cp -r $CD_MOUNT/.products/hotjava/.hotjava $HOME
dir_exist=0
fi
echo ""
echo "Please wait, Catalyst CDware is starting ..."
echo ""
echo "Please note the following:"
echo "--------------------------"
echo "- To run many of the slide shows there must be at least 5 megabytes"
echo " of available disk space in /tmp. Please verify the available disk"
echo " space in /tmp before running the slide shows."
echo " "
echo " "
#$CD_MOUNT/.products/hotjava/$CDWARE_ENV/bin/hotjava http://localhost:7999/CDware
$CD_MOUNT/.products/.bin/httpd/$CDWARE_ENV/welcome 120 &
$CD_MOUNT/.products/hotjava/$CDWARE_ENV/bin/hotjava file:///tmp/httpd/.products/CDware/index.html
#
# clean-up
#
if [ $CDWARE_ENV != "Solaris_1" ]; then
audioplay -i $CD_MOUNT/.products/CDware/sounds/bye.au&
else
cat $CD_MOUNT/.products/CDware/sounds/bye.au > /dev/audio&
fi
# restore mailcap file
if [ -r $HOME/.mailcap.cdware ]; then
mv $HOME/.mailcap.cdware $HOME/.mailcap
fi
# mail or print more information request
if [ -r /tmp/httpd/info.email ]; then
echo "------------------------------" >> /tmp/httpd/info.email
/usr/ucb/mail -s "CDware Lead for Your Product" < /tmp/httpd/info.email cdwareemlts@sun.com
fi
if [ -r /tmp/httpd/info.fax ]; then
echo "------------------------------" >> /tmp/httpd/info.fax
echo "" >> /tmp/httpd/info.fax
echo "FAX US! at (415)961-6070" >> /tmp/httpd/info.fax
echo "" >> /tmp/httpd/info.fax
echo "------------------------------" >> /tmp/httpd/info.fax
/usr/ucb/lpr /tmp/httpd/info.fax
fi
# kill httpd
kill -9 `cat /tmp/httpd/logs/httpd.pid`
# Clean up wais stuff:kill wais, remove link
rm -f /tmp/.wais /tmp/waisserver.log
kill -9 $pid
# remove httpd config
rm -rf /tmp/httpd
# remove .hotjava
if [ "$dir_exist" = "1" ]; then
rm -r $HOME/.hotjava
mv $HOME/.hotjava.cdware $HOME/.hotjava
else
rm -rf $HOME/.hotjava
fi
exit 0