#!/bin/sh
#
# Script to automate initiation of multicast from 2nd Int. WWW Conf. (Chicago)
# October 1994, RPC Rodgers, NLM
#
# vat -C 2nd Int. WWW Conf. (Chicago) -n 224.2.132.174/49180/31795//127 
# nv -ttl 127 224.2.132.174 52190
#
# Define variables
#
# Multicast group address
multi_grp_add=224.2.132.174
# Conference title
title="2nd Int. WWW Conf. (Chicago)"
# Audio variables
audio_port=49180
audio_conf_id=31795
# Default (used if audio_format is empty) is pcm; use dvi4 to reduce bandwidth
audio_format="pcm4"
audio_time_to_live=127
# Video variables
video_port=52190
video_time_to_live=127
#
sd="/home/webconf/bin/sd"
vat="/home/webconf/bin/vat"
nv="/home/webconf/bin/nv"
#
# Find out if this script is running in a scrolling window
#
date_string="`date`"
file_string="`echo $date_string | sed -e 's^... ... \([0-9 ][0-9]\) \([0-9 ][0-9]:[0-9][0-9]:[0-9][0-9]\).*\1_\2'`"
file="MULTICAST${file_string}.log"
echo "Multicasting for: $title
Started: $date_string
"
#
# Start multicasting tools
#
dummy="`ps -ef | grep $sd | wc -l`"
case "$dummy" in
   [0-1]) ;;
   *) $sd & ;;
esac
echo "Starting multicast video tool (nv)"
$nv -ttl ${video_time_to_live} \
   ${multi_grp_add} \
   ${video_port} &
#
echo "Starting multicast audio tool (vat)"
$vat -C "$title" \
    -k \
    -N "$title" \
    -n \
    -S \
    ${multi_grp_add}/${audio_port}/${audio_conf_id}/${audio_format}/${audio_time_to_live} \
    | tee $file &
#
# Print further instructions
#
echo "
IMPORTANT:

1) Select Encodings in nv and set to \"Sun CellB.\"

2) "su" to root in one of the windows.

3) If necessary, start a talk process to Jules Aronson at the National Library
   of Medicine with \"talk aronson@conference1.nlm.nih.gov\"
   (IP address: 130.14.15.50).

4) If either nv or vat require restarting, *DO NOT* restart them from sd:
   use start.vat or start.nv.

5) Remember to save the participant list *prior* to exiting vat.  Do this
   by typing the letter \"l\" while the cursor is positioned within the
   vat window.  This will cause the list to be written into this window
   AND into a file.

6) *DO NOT* type \"q\", \"Q\", \"Ctrl-C\" or \"Ctrl-D\" while the cursor
   is positioned witin the vat or nv windows; this will abort these
   applications!

GOOD LUCK..." 
#
# end of script