#!/bin/bash #################################################### # # Installation Script NEESGrid TPM Servers # Note this script is for a NEW Installation # it does not preserve any old files and over # writes everything # #################################################### # Version History # # 2003012601 - code creation Jan 2003 Release Version 1.0 # 2003013102 - correction of Perl location & fix of htdocs copy command # 2003020803 - changes to fix RW protection on ENotebook installation # 2003020804 - changes to fix TRoboticCamera spelling in TPMConfig.txt # 2003060305 - changes to ffmpeg-0.4.6 distribution # 2003060806 - changes to text messages # 2003061307 - updated for release version 1.2 # 2003061308 - fixed missing password for BW directories version 1.2 # 2003100209 - updated for October 2003 Release Version 2.0 # 2003100710 - updated for Red Hat 8.0 installations # 2003121611 - updated for Red Hat 9.0 installations Release Version 2.1 # 2004010912 - text changes in script to mitigate confusion during data entry. # 2004010913 - script changes to install more than 5 cameras etc.... # 2004062814 - update to install version 3.0 files # 2004062815 - updated to change protection of various installed files # 2004060416 - updated to change protection of perl.conf & other new files # 2004110117 - updated to V3.02 release # 2005011818 - updated to V3.04 release # #################################################### Version="2005011818-NJZ-TPMRel-V3.0.4" #################################################### #################################################################################### # # Copyright (C) 2001, 2002, 2003, 2004, 2005 Nestor J. Zaluzec # #################################################################################### # # this is the name of the tarball that this script will be using # as the source of all its files for installation # NJZTPMtarball="NJZTPM-V3.0.4.tar" NJZTPM="NJZTPM-V3.0.4" # #-------------------- create a log file to record everything -------------------- # # make a log file to record what was done # LOG="/var/www/htdocs/TPMlogs/TPMnewinstall.log" LOGfinal="" # does an existing Log & Directory exist? if [ ! -e ${LOG} ]; then # it doesn't so let's create a temporary place # for the log files exist. We will move it later if [ ! -d /tmp1/TPMlogs/ ]; then mkdir /tmp1/TPMlogs/ fi LOGfinal=${LOG} LOG="/tmp1/TPMlogs/TPMnewinstall.log" touch ${LOG} fi if [ -e ${LOG} ]; then # # make a backup of any old log file if it exists and create a new blank one # mv ${LOG} ${LOG}-$(date --utc +%FT%TZ) fi # just make sure a Log file exists touch ${LOG} #-------------------- Everything after this point is now being recorded --------------- #printf "###################################################\n" >> $LOG #printf "This Log created on $(date)\n" >> $LOG #printf "###################################################\n\n" >> $LOG chmod 600 $LOG # # record everything to the log file # # the ( below is the start of the subshell command which groups everything # below into one massive "command" which is to be streamed into tee so # that a log file can be created. ( printf "\n\n\n\n\n\n\n"; printf "************************************************ \n"; printf "Installation of TP Servers and Code\n"; printf "Script Version: $Version\n"; printf "************************************************ \n\n"; printf "\n\nInstallation Started: $(date)\n"; printf "\n\n\n"; printf "****************************************************** \n" printf "Preparing to Create a NEW TPM Installation \n" printf "****************************************************** \n\n" printf " **** you must be logged in as a SuperUser ****** \n\n" printf "****************************************************** \n\n" printf "\n\n\n Ready to Continue [ yes/no ]:?" read ANS printf $ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'n' -o $ANS = 'N' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi # # now check just to be sure ! # if [ `id -un` != "root" ]; then printf "\n\n\n This script must be run as root. \n\n\n" exit 1 fi #----------------------------------------------------------------------------------- # # make sure we have the correct files # printf "\n\n\n Have the all installation files been copied to /tmp1 yes/no ]:?" read ANS printf $ANS # # okay let's just check to make sure it is really there # if [ ! -e /tmp1/$NJZTPMtarball ]; then printf "\n\n Critical Installation File missing [$NJZTPMtarball]" printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi # # also check for httpd # if [ ! -e /usr/sbin/httpd ]; then printf "\n\n Critical Installation File missing [Apache - httpd!!]" printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped please copy files to /tmp1 directory \n\n" exit fi # # # lets document the system configuration in the log files # printf "\n******************************" printf "\nCPU information" printf "\n******************************\n" cat /proc/cpuinfo printf "\n******************************" printf "\nLinux OS information" printf "\n******************************\n" cat /proc/version cat /etc/redhat-release # # Change to tmp install directory # printf "\n\nChanging to default installation directory \n"; printf "************************************* \n\n"; #%% cd /tmp1 # # Untar the Distribution File # printf "\n\nUntarring the TPM Distribution File \n" printf "*********************************** \n\n" #%% tar xvf $NJZTPMtarball # # change to the correct directory # #%% cd /tmp1/$NJZTPM #------------------------------------------------------------------------------- # Begin installation of Broadware Server #------------------------------------------------------------------------------- echo "------------------------------------" printf "\n\nInstalling Broadware IMS Files \n" printf "********************************** \n\n" echo "------------------------------------" #%% # # Install the BW rpm package # # # the default version of BW is intended for RH 7.3 # if installed on RH 8.0 some librarires are missing or faulty # specifically libdb.so.3, it will depend upon if this is a new # versus an upgraded installation. Upgrades will still have the old # libraries on the disk. new RH installs will not have the libraries # BWI="Not Installed" # this is a flag to keep track if Broadware is installed or not cat /etc/redhat-release echo " " printf " \nPlease Confirm version of RedHat are you running [ 7 , 8 , 9 , (Enterprise=9)], Enter a RH Version Number!:? " read ANS printf $ANS if [ $ANS != '7' -o $ANS != '8' ]; then printf "\n RH 9/Enterprize (default) selected \n\n" if [ $ANS = '' -o $ANS = ' ' ]; then ANS="9" fi fi if [ $ANS = "9" ]; then printf " \n You are running RH 9, hence we must install Berkeley DB compatibility libraries" printf " \n and ImageMagicK utilities\n" printf " \n These are used by the Broadware IMS Proxy Server and ENotebook respectively\n" rpm -i /tmp1/$NJZTPM/compat* rpm -F /tmp1/$NJZTPM/ImageMagick-5.4.7-10.i386.rpm # # install symbolic link to libraries that Broadware needs # if [ ! -e /lib/libdb.so.3 ]; then printf "/lib/libdb.so.3 does not exist creating a link to BW installed package\n" ln -s /lib/libdb2.so.3 /lib/libdb.so.3 fi # # in version 9 and Enterprize the location of the "convert" utility program from ImageMagicK # has changed create a link from the original location in 7.x to the new location # Just incase ImageMagicK is not installed do it. BWI="Installed" fi if [ $ANS = "8" ]; then printf " \n You are running RH 8, hence we must install Berkeley DB compatibility libraries\n" printf " \n These are required by the Broadware IMS Proxy Server support\n" rpm -i /tmp1/$NJZTPM/compat-db-3.3.11-2.i386.rpm BWI="Installed" fi # # yes, this is RH 7.3 so do things the correct way # tar xvf bw_ims-linux.tar # this is for RH 7.3 rpm -ivh BroadWare-2.0-1.i386.rpm_02_07_25 BWI="Installed" # # the rest of this remains the same regardless of the version of RH # # # Configure aliases # #%% ln -s /usr/BWhttpd /usr/httpd # # this is the location of where the BW license should be installed # BWLicLocation="/usr/httpd/root/etc/license" # # Installation of BW license # TEST="Installed" if [ $BWI = $TEST ]; then # printf "BW installed" # # #Start of skip BW if statement # printf "\n\n Full functionality of the TPM Server requires a Broadware IMS 2.0 license" printf "\n\n Authorized NEES Sites can obtain a free NEES- Broadware license by contacting Nestor Zaluzec\n" printf "\n Installation can proceed without a license, and it can be added later" printf "\n\n\n Do you have a Broadware License [ yes (default) , no ]:?" read ANS printf $ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then # nope we don't have a license, lets continue as best we can printf "\n BW Installation skipped: You will have to install the license later \n\n" printf "Use a text Editor and copy the license into the file $BWLicLocation \n\n" else # we have a license so lets install it in the correct file printf "\n\nPreparing to install the BW Licence \n" printf "************************************* \n\n\n" printf "Enter your BW license 24 Character-Pair Hexidecimal Key \n" printf "> " read BWLicense printf "\n" printf "You entered the value [ " printf "$BWLicense" printf " ] \n which will be installed in $BWLicLocation \n\n" #touch $BWLicLocation #chmod 777 $BWLicLocation printf "$BWLicense" > $BWLicLocation chmod 444 $BWLicLocation fi # # copy BW configuration files to default location # printf "Copy configuration of BW to default locations \n" #%% cp /tmp1/$NJZTPM/BWsystem.cfg /usr/httpd/conf/system.cfg #%% cp /tmp1/$NJZTPM/BWhttpd.conf /usr/httpd/conf/httpd.conf # # create a default directory for BW data # this directory isn't used but it is required # for BW to work. # # #%% mkdir /data chown nobody /data chmod 755 /data # # put in a pause so you can see what has been done # # #END of skip BW if statement # else printf "\n BW was not installed\n" fi printf "\n\n\n\n\n\n\n"; printf "************************************ \n"; printf "Installation of BW Server Completed\n"; printf "************************************* \n\n"; printf "\n\n\n Ready to Continue [yes (default), no ]:?" read ANS printf $ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi #------------------------------------------------------------------------------- # # Installing the correct version of Java needed by Broadware # #------------------------------------------------------------------------------- echo "------------------------------------" printf "\n\nInstalling Java JDK 1.4.2 \n" echo "------------------------------------" echo "" # # chmod and uncompress and install the BW required Java RPM package # #%% chmod +x j2sdk-1_4_2_06-linux-i586-rpm.bin #%% ./j2sdk-1_4_2_06-linux-i586-rpm.bin #%% rpm -i j2sdk-1_4_2_06-linux-i586.rpm # # now make the correct links so that java can be found and the config files are correct # #%% ln -s /usr/java/j2sdk1.4.2_06 /usr/java/jdk1.4.2 #%% ln -s /usr/java/j2sdk1.4.2_06/bin /usr/java/bin #%% # # note the correct jvm.cfg file must be used especially for RH 9! # cp /tmp1/$NJZTPM/jvm.cfg /usr/java/j2sdk1.4.2_06/jre/lib/jvm.cfg # # put in a pause so you can see what has been done # printf "\n\n\n\n\n\n\n"; printf "************************************ \n"; printf "Installation of Java Completed\n"; printf "************************************* \n\n"; printf "\n\n\n Ready to Continue [ yes (default), no ]:?" read ANS printf $ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi #------------------------------------------------------------------------------- # # Begin Apache modifications # #------------------------------------------------------------------------------- echo "" echo "------------------------------------------------" echo "Beginning Modification & Install of Apache files" echo "------------------------------------------------" # # copy the httpd configuration files # #%% cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original # #print out the version of Apache # printf "\n You have the following Version installed: \n\n" /usr/sbin/httpd -v | grep Apache printf "\n\n... Okay to save me time look at the preceeding line" printf "\n\n Are you using Version 2.x of Apache [ yes (default), no ]:?" read ANS printf $ANS if [ $ANS = 'yes' -o $ANS = 'YES' -o $ANS = 'Yes' -o $ANS = 'Y' -o $ANS = 'y' ]; then # not Version 1.3 then we must be at the 2.0 level cp /tmp1/$NJZTPM/TPMApache2.x.httpd.conf /etc/httpd/conf/httpd.conf mv /etc/httpd/conf.d/perl.conf /etc/httpd/conf.d/perl.conf.original cp /tmp1/$NJZTPM/perl.conf /etc/httpd/conf.d/httpd.conf else cp /tmp1/$NJZTPM/TPMApache1.3x.httpd.conf /etc/httpd/conf/httpd.conf printf "\n\n You must therefore be using Version 1.3x of Apache!" fi # # change the startup configurations to make sure that everything starts # #%% rm /etc/rc5.d/K15httpd #%% cp /etc/init.d/httpd /etc/init.d/httpdNJZ cp /etc/init.d/httpd.origyes /etc/init.d/httpdNJZ #%% chmod +x /etc/init.d/httpdNJZ #%% ln -s /etc/init.d/httpdNJZ /etc/rc5.d/S92httpdNJZ # # Begin installation of the htdoc files # #%% tar xvf TPMhtdocs.tar # # A little safety measure if the htdoc file exists rename it # if [ -d /var/www/htdocs ]; then mv /var/www/htdocs /var/www/htdocs-backup-$(date --utc +%FT%TZ) printf "\n*** Warning: an old htdocs directory was found \n" printf "*** it has been backuped as var/www/htdocs-backup-$(date --utc +%FT%TZ)\n" fi #%% cp -rf /tmp1/$NJZTPM/htdocs /var/www/ ## this is the public site so make things writable as needed #%% chown apache /var/www/htdocs/NJZENote chown apache /var/www/htdocs/ENoteArchive chown apache /var/www/htdocs/VideoArchive chown apache /var/www/htdocs/NJZENote/entries-* chown apache /var/www/htdocs/NJZENote/entries-*/*.* chmod 777 /var/www/htdocs/NJZENote chmod 777 /var/www/htdocs/*.count chmod 777 /var/www/htdocs/NJZENote/entries-* chmod 777 /var/www/htdocs/NJZENote/entries-*/*.* #%% chmod 777 /var/www/htdocs/VideoArchive chmod 777 /var/www/htdocs/VideoArchive/*.* #%% chmod 777 /var/www/htdocs/XMLJava/*.* chmod 777 /var/www/htdocs/Status*.* # chmod 777 /var/www/htdocs/TR*.html #----------------------------------------------------------------- # now install the various security bits for public/private access #----------------------------------------------------------------- # # untar and install the security related files for htpasswd/htgroup files # tar xvf TPMSecurity.tar cp -rf /tmp1/$NJZTPM/security /var/www/ chown apache /var/www/security chown apache /var/www/security/ht* # # untar and install usermanage # zcat user_manage.tar.gz | tar xv cd /tmp1/$NJZTPM/HTTPD-User-Manage-1.61 perl Makefile.PL make make test make install chown apache /var/www/htdocs/NJZ*.pl # # A little safety measure if the htdoc file exists rename it # # if [ ! -e /etc/httpd/conf/realms.conf ]; then # # mkdir /etc/httpd/ # "\n*** Warning: an /etc/httpd/conf/realms.conf was not found \n" # # fi mv /etc/httpd/conf/realms.conf /etc/httpd/conf/realms.conf.original cp /tmp1/$NJZTPM/realms.conf /etc/httpd/conf/realms.conf # # Copying Administrative passwords for Admin Directory # # cp /tmp1/$NJZTPM/TPM.htaccess /var/www/htdocs/Admin/.htaccess # # Copying Administrative passwords to the BW directories # cp /tmp1/$NJZTPM/TPM.htaccess /usr/httpd/root/htdocs/.htaccess cp /tmp1/$NJZTPM/TPM.htaccess /usr/httpd/root/htdocs/BWT/.htaccess #%% cp /tmp1/$NJZTPM/security/htgroupfile /usr/httpd/root/htgroupfile #%% cp /tmp1/$NJZTPM/security/htpasswdfile /usr/httpd/root/htpasswdfile #---------------------------------------------------------------------------------------------- echo "------------------------------------ " echo "Installing CGI.pm" echo "------------------------------------ " # # install CGI.pm since not everyone may have it installed. # cd /tmp1/$NJZTPM/ zcat /tmp1/$NJZTPM/CGI.pm.tar.gz | tar xv cd /tmp1/$NJZTPM/CGI.pm-3.04 perl Makefile.PL make make install echo "------------------------------------ " echo "Installing CGI.pm completed" echo "------------------------------------ " echo "------------------------------------ " echo "ReStarting IMS and Apache Servers" echo "------------------------------------ " # # now startup the Apache and IMS servers # #%% if [ $BWI = $TEST ]; then # only try to start it if it is installed !!!! /etc/init.d/ims start #%% fi /etc/init.d/httpdNJZ start # # put in a pause so you can see what has been done # printf "\n\n\n\n\n\n\n"; printf "************************************ \n"; printf " Apache Servers Completed\n"; printf "************************************* \n\n"; printf "\n\n\n Ready to Continue [ yes (default), no ]:?" read ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi # # # #------------------------------------------------------------------------------- # # Install ffmpeg # #------------------------------------------------------------------------------- echo "------------------------------------ " echo "Installing FFMpeg 0.4.6" echo "------------------------------------ " #%% cd /tmp1/$NJZTPM tar xvf /tmp1/$NJZTPM/ffmpeg-0.4.6-Sept2002.tar # # warning new versions of ffmpeg are broken wrt Axis units # thus we are intentionally using a very specific old version (0.4.6) # note this is the Sept release not the Dec one # also both releases have the SAME version number # December fails to work with the Axis Units but Sept works #%% cd /tmp1/$NJZTPM/ffmpeg-0.4.6-Sept2002/ffmpeg/ #%% ./configure #%% make #%% make install #%% cd .. # # put in a pause so you can see what has been done # printf "\n\n\n\n\n\n\n"; printf "************************************ \n"; printf "Installation of FFMPEG Completed\n"; printf "************************************* \n\n"; printf "\n\n\n Ready to Continue [ yes (default), no ] :?" read ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi #------------------------------------------------------------------------------- # #Now start working to create the various TPM files # #------------------------------------------------------------------------------- echo "------------------------------------ " echo " TPM Configuration Starting" echo "------------------------------------ " #--------------------------------------------------------- # Get information for the TPMConfiguration File #--------------------------------------------------------- # # define some locations information which will be needed for the installation # TPMConfigFile="/var/www/htdocs/TPMConfiguration.txt" TPMConfigHeader="/var/www/htdocs/PerlCode/TPMConfiguration.header" # # create a backup if a file already exists # if [ -e ${TPMConfigFile} ] then printf "\n TPM Configuration Files Exists Backup Copy Created "; cp $TPMConfigFile $TPMConfigFile-$(date --utc +%F-%T) fi NullValue="" printf "\n\n\n****************************************************** \n" printf "Preparing to Create the TPM Device Configuration File \n" printf "****************************************************** \n" printf "If a device is not present enter a \n" printf "******************************************************* \n" printf "\n\n" printf "******************************************************* \n" printf "Collecting Site Specific information \n" printf "******************************************************* \n\n" printf " 0.) Enter a Short Abbreviated University/Site Name for this TPM Server [Univ._of_XYZ]:" read TPMSiteName if [ ! $TPMSiteName ] then TPMSiteName="TPM_Server" fi printf "$TPMSiteName " printf "\n" printf " \n 1.) Enter IP address of this TPM Server [www.xxx.yyy.zzz]: "; read TPMHomeIP; if [ ! $TPMHomeIP ] then printf "\n Error your TPM Home IP Address must be provided. \n\n"; exit; else printf "$TPMHomeIP "; printf "\n"; fi printf "\n 2.) Enter IP address of the NEESPop Computer [www.xxx.yyy.zzz]:" read NEESPopHomeIP; if [ NEESPopHomeIP = "" ] then NEESPopHomeIP=" " fi printf "$NEESPopHomeIP " printf "\n" printf "\n 3.) Enter IP address of the DAQ/LabView Computer [www.xxx.yyy.zzz]:" read LVHomeIP; if [ LVHomeIP = "" ] then LVHomeIP=" " fi printf "$LVHomeIP " printf "\n" printf "\n 4.) How Many Video/Image Sources will be at this Site [ Enter a number 0-N ] :?" read NumOfImageSources printf $NumOfImageSources printf "\n" # note in the future some "image sources" may not be video cameras" # # start NumOfImageSources if statement # if [ $NumOfImageSources -gt 0 ] then #---------------------------------------- # # Ask a few questions now about MSIE BW etc.. # #---------------------------------------- printf "\n" printf "****************************************************** \n\n" printf "Do you wish to install MSIE Support on this Site? \n\n" printf "******************************************************* \n" printf "Note: Bill Gates & MSIE Browsers do not support JPEG ServerPush\n" printf "Mode which is the default method used for TPM Imaging. \n" printf "MSIE can be used to parse images from this TPM Site but \n" printf "to do so the requires that client by-pass the default Server\n" printf "software. If MSIE support is selected users will have direct \n" printf "access to the Internet Video Appliance using an ActiveX module which \n" printf "must be downloaded and installed by each remote client. This will\n" printf "ultimately cause a performance degradation of the video server as\n" printf "it directly connects to and loads down the Internet Video Appliance. \n" printf "\nThus, MSIE is NOT a recommended Browser for TPM Site access.\n\n" printf "However, support for MSIE is included to allow this \n" printf "decision to be made by the local Site. \n\n" printf "If you select NO, then users logging in with MSIE will receive a message \n" printf "informing them to use Netscape. If you select YES, then \n" printf "users logging in MSIE will receive a message informing them to \n" printf "install an ActiveX module. \n\n" printf "******************************************************* \n" printf "\n\n\n Install MSIE compatibility yes/no [ yes (default), no ]:?" read ANS if [ $ANS = $NullValue ] then ANS="yes" fi printf "$ANS" printf "\n" if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ] then printf "\n MSIE compatibility WILL NOT beinstalled \n\n" MSIE="no" else printf "\n MSIE compatibility WILL be installed \n\n" MSIE="yes" fi printf "\n\n\n Have you PRE-CALIBRATED your Video FPS [ yes (default), no ]:?" read ANS if [ $ANS = $NullValue ] then ANS="yes" fi printf "$ANS" printf "\n" if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ] then FPS=1 else printf "\n Enter the FPS Calibrated Input Rate\n\n" read FPS fi # # now store the results # FPS="SourceFPS=$FPS"; MSIE="MSIE=$MSIE"; # # end NumOfImageSources if statement # else NumOfImageSources="0"; fi #---------------------------------------- # # We now have all the information needed # create the TPM configuration file # #---------------------------------------- printf "\n" printf "\n\n******************************************************* \n" printf "\n Creating TPM Configuration File\n" printf "\n\n******************************************************* \n" # # Now create the configuration file # # First put the Header lines into the file cp $TPMConfigHeader $TPMConfigFile # # append new information to the file # printf "TPMSiteName=$TPMSiteName\n" >> $TPMConfigFile printf "TPMHome=$TPMHomeIP \n" >> $TPMConfigFile printf "NEESPopHome=$NEESPopHomeIP \n" >> $TPMConfigFile printf "DAQHome=$LVHomeIP \n" >> $TPMConfigFile printf "NumOfImagesSources=$NumOfImageSources \n" >> $TPMConfigFile # # create a small loop to gather all the parameters for the various cameras # value=1 while [ $value -le $NumOfImageSources ] do # printf "\n Current Number = $value of $NumOfImageSources \n" printf "\n -) Enter IP address of Image Source $value [www.xxx.yyy.zzz]:" read ImageSourceIP if [ $ImageSourceIP = $NullValue ] then ImageSourceIP=" "; fi printf "$ImageSourceIP " printf "\n" printf "\n -) Image Source $value i.e. Type of Internet Appliance [ Axis2400 (default) ]:" read ApplianceType if [ $ApplianceType = $NullValue ] then ApplianceType="Axis2400"; fi printf "$ApplianceType" printf "\n" printf "\n --) Enter Image Source $value Input Connector [1 (default), 2, 3, 4]:" read VideoInput if [ $VideoInput = $NullValue ] then VideoInput="1"; fi printf "$VideoInput" printf "\n" printf "\n --) Image Source $value Streaming Format [ Broadware (default) , ServerPush ]:" read StreamingFormat if [ $StreamingFormat = $NullValue ] then StreamingFormat="Broadware"; fi printf "$StreamingFormat" printf "\n" printf "\n --) Is this a TeleRobotic Camera [ yes (default), no ]:" read TRobotic if [ $TRobotic = $NullValue ] then TRobotic="yes"; fi printf "$TRobotic" printf "\n" TR="yes"; if [ $TRobotic = 'no' -o $TRobotic = 'NO' -o $TRobotic = 'No' -o $TRobotic = 'N' -o $TRobotic = 'n' ]; then TR="no" fi printf "\n --) Is this a PUBLIC Camera [ yes (default), no ]:" read Accs if [ $Accs = $NullValue ] then Access="public"; fi printf "$Accs" printf "\n" Access="public"; if [ $Accs = 'no' -o $Accs = 'NO' -o $Accs = 'No' -o $Accs = 'N' -o $Accs = 'n' ]; then Access="private" fi printf "\n --) Image Source Description for MetaData [ enter simple text description/location etc...]:" read SourceMetaDataDescription printf "$SourceMetaDataDescription" printf "\n" # # now append the information input by the user # # # but don't write out parameters for Axis Units which are not defined # this is so that the correct HTML is constructed # if [ $ImageSourceIP ]; then ApplianceType="SourceType=$ApplianceType" VideoNum="SourceNumber=$value" ImageSourceIP="SourceIP=$ImageSourceIP"; VideoInput="SourceInputID=$VideoInput"; StreamingFormat="StreamFormat=$StreamingFormat"; TR="TRobotic=$TR"; MD="Description=$SourceMetaDataDescription"; PB="Access=$Access"; else VideoNum=" "; ImageSourceIP=" "; VideoInput=" "; StreamingFormat=" "; TR=" "; MD=" "; PB=" "; fi printf "$ApplianceType \t $VideoNum \t $ImageSourceIP \t $VideoInput \t $FPS \t $MSIE \t $StreamingFormat \t $TR \t $MD \t $PB \n" >> $TPMConfigFile # # increment the loop variable # let "value = value + 1" ; done printf "##### End of Configuration File ##### \n" >> $TPMConfigFile # # print out the results for the log file # cat $TPMConfigFile #------------------------------------------------------------------------------------------------ # # make sure perl is linked just in case an old script is used. # ln -s /usr/bin/perl /usr/bin/perl5 # # # put in a pause so you can see what has been done # printf "\n\n\n\n\n\n\n"; printf "************************************ \n"; printf " TPM Configuration Completed\n"; printf "************************************* \n\n"; printf "\n\n\n Ready to Continue [ yes (default), no ]:?" read ANS printf $ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi # # Create the Other bits of HTML Code # echo " " echo "-----------------------------------------------------" printf "\n Creating remaining TPM related files \n\n" echo "-----------------------------------------------------" # # # echo " " echo "------------------------------------ " echo " Updating General HTML Files " echo "------------------------------------ " # # Run the TPM Site Creator program # /var/www/htdocs/PerlCode/TPMConfiguration.pl echo "------------------------------------ " echo " Updating Collab Sites HTML Files " echo "------------------------------------ " # # Run the TPM Site Collaboration program # /var/www/htdocs/PerlCode/TPMCollaboratories.pl # # # echo "------------------------------------ " echo " Creating the ENotebook Files " echo "------------------------------------ " # # Creating ENotebook Files # /var/www/htdocs/NJZENote/CreateNoteBookImageSourceFile.pl # echo "-----------------------------------------------------" printf "\n Defining Video Proxies \n\n" echo "-----------------------------------------------------" printf "\n\n*** disabling htaccess files ***\n" # # some site have installed htaccess files in BW directories this renames them temporairly # mv /usr/httpd/root/htdocs/.htaccess /usr/httpd/root/htdocs/temp.htaccess mv /usr/httpd/root/htdocs/BWT/.htaccess /usr/httpd/root/htdocs/BWT/temp.htaccess # # Finally startup all Video Proxies # printf "*** running the proxy update scripts ***\n" /var/www/htdocs/PerlCode/StartUpAllVideoProxies.pl # # now return the access file back to normal # mv /usr/httpd/root/htdocs/BWT/temp.htaccess /usr/httpd/root/htdocs/BWT/.htaccess # # if you uncomment the line below all video streams will require password submission # # mv /usr/httpd/root/htdocs/temp.htaccess /usr/httpd/root/htdocs/.htaccess # printf "*** enabling htaccess files ***\n" echo "-----------------------------------------------------" # # put in a pause so you can see what has been done # printf "\n\n\n\n\n\n\n"; printf "************************************ \n"; printf "Video Proxy Server Completed\n"; printf "************************************* \n\n"; printf "\n\n\n Ready to Continue [ yes (default), no ]:?" read ANS printf $ANS if [ $ANS = 'no' -o $ANS = 'NO' -o $ANS = 'No' -o $ANS = 'N' -o $ANS = 'n' ]; then printf "\n Installation stopped: report any problems/errors to zaluzec@aaem.amc.anl.gov \n\n" exit fi # # Installation is complete (we hope) # echo "-----------------------------------------------------" echo " Installation Completed (Hopefully) " echo "Use your Netscape Browser to access the TPM Site" echo " at http://$TPMHomeIP" echo "-----------------------------------------------------" echo "" echo " Remember to upload your site specific LOGO to /var/www/htdocs/Images " echo " you should replace the file TPMBannerLogo.gif with your own Banner (~600x60 pixels) " echo "" echo "-- Nestor --" echo "------------------------------------ " echo " Please reboot your system now " echo "------------------------------------ " printf "###################################################\n" printf "Installation Finished on $(date)\n" printf "###################################################\n\n" printf "You may have to Cntrl-C out of this script if it hangs" printf "###################################################\n\n" # # the ) below ends the subshell command , this is all piped into tee below and # recorded in a log file. ) 2>&1 | tee -a $LOG # finally move the log file to its resting place # # # Mail a copy of the configuration to Nestor Zaluzec (NEES SI TPM Lead) # # #if [ -e /var/www/htdocs/TPMConfiguration.txt ]; then # mail zaluzec@aaem.amc.anl.gov -s "TPMConfiguation $TPMSiteName $TPMHomeIP" < /var/www/htdocs/TPMConfiguration.txt #fi # # NEES Site administrator you may comment out the above line if you prefer, but I would like to # be kept informed of any installations so that I can debug things when problems occur. # you will notice that no login information is being transmitted by the above Email. # # #--------------- End of TPM (NEW Site) Installation Script ------------------- printf "\n *** That's all folks *** \n\n" exit;