head	1.9;
access;
symbols
	Hobson_Rock_14Dec2009:1.9
	HEAD_CTD_MERGE:1.9.0.6
	BEFORE_VCS_CHANGE:1.9
	Hobson_Rock_16Oct2009:1.9
	Hobson_Rock_29June2009:1.9
	Jun15_2009:1.9
	Apr_7_2009:1.9
	mar19_2009:1.9
	mar18_2009:1.9
	feb13_2009:1.9
	feb10-2009:1.9
	feb09-2009:1.9
	dec15_2008:1.9
	dec12_2008:1.9
	ST_10_5:1.9
	ST_10_4b:1.9
	ST_10_4:1.9
	ST_10_3:1.9
	ST10_HW:1.9
	ST_10_2:1.9
	ST_10_1:1.9
	ST_10_0:1.9
	AUTONOMY_BRANCH:1.9.0.4
	AUTONOMY:1.9
	AUTONOMY-2008_07_30:1.9
	TREX_ST_1_0:1.9
	RELEASE_27_April_2007_CTD_1:1.9.0.2;
locks; strict;
comment	@# @;


1.9
date	2004.12.21.23.16.26;	author dorado;	state Exp;
branches;
next	1.8;

1.8
date	2004.12.21.20.52.53;	author dorado;	state Exp;
branches;
next	1.7;

1.7
date	2004.12.20.21.35.40;	author dorado;	state Exp;
branches;
next	1.6;

1.6
date	2004.12.20.21.25.28;	author dorado;	state Exp;
branches;
next	1.5;

1.5
date	2004.10.11.23.49.33;	author dorado;	state Exp;
branches;
next	1.4;

1.4
date	2004.10.08.23.26.47;	author dorado;	state Exp;
branches;
next	1.3;

1.3
date	2004.10.07.18.42.57;	author dorado;	state Exp;
branches;
next	1.2;

1.2
date	2004.10.06.22.03.44;	author dorado;	state Exp;
branches;
next	1.1;

1.1
date	2004.10.06.18.49.59;	author dorado;	state Exp;
branches;
next	;


desc
@@


1.9
log
@Use IP address for jeckel.shore.mbari.org (not in /etc/hosts ?).
@
text
@#!/bin/ksh
#
# Script to construct the arguments for the adx command.
# If Mission directory name is not passed as an argument then
# prompt user for directory name and validate it's existence
# before executing the adx command.  If the portal computer
# changes then edit the portal_name variable.
#
# Mike McCann  6 October 2004
#
# $Id: upload,v 1.8 2004/12/21 20:52:53 dorado Exp $

# SSDS Portal computer
#portal_name=134.89.13.120
#portal_name=auv-2-control

#portal_name=jeckel.shore.mbari.org
portal_name=134.89.12.45
portal_port=9010
echo "Missions will be sent to AUVPortalService: $portal_name:$portal_port"

# Vehicle Computer attributes
vc_name=mvc-dmo1
vc_login=dorado1
vc_pw=dorado1

# Location of log data files on the vehicle copmuter
log_path=/home/dorado1/auv/altex/onboard/logs

# Set the mission to upload
if test $1
then
   log_dir=$1
   echo "log_dir = $log_dir"
else
   echo "Enter mission to upload (YYYY.DDD.MM): \c"
   read log_dir
fi

# Test that log_dir is a directory that exists
if [ ! -d "$log_path/$log_dir" ]
then
   echo "\nDirectory $log_path/$log_dir does not exist.  Exiting.\n"
   exit -1
fi

# Set campaign name
if test $2
then
   campaign=$2
else
   echo "Enter campaign name (e.g. AUVCTD, BIOLUME, OCCO): \c"
   read campaign
fi

# Test that entered campaign name is valid - add more to this if it needs to be checked
if [ "$campaign" = "AUVCTD" -o "$campaign" = "BIOLUME" -o "$campaign" = "OCCO" ]
then
   echo "campaign = $campaign"
else
   echo "$campaign is not a known name.  Do you still want to use it? (y/n) \c"
   read ans
fi
if [ "$ans" = "n" -o "$ans" = "N" ]
then
   exit -2
fi

# Construct "survey" name from log directory string (remove mission number and periods)
yyyyddd=`echo $log_dir | sed 's/\.[0-9][0-9]$//' | sed 's/\.//g'`;
survey_name="${campaign}${yyyyddd}"

# Offer to not remove existing (e.g. 2004.271.00_data.tar.gz) tarball in mission directory.
tarball="$log_path/$log_dir/${log_dir}_data.tar.gz"
if [ -f $tarball ]
then
   echo "Removing previous tarball: $tarball"
   rm $tarball
fi

adx_string="adx $portal_name $vc_name $vc_login $vc_pw $portal_port $survey_name $log_path/$log_dir "


# Execute adx command (portal must be running)
echo "Executing:  "
echo $adx_string
$adx_string

if [ $? != 0 ]
then
   echo "*** Data not uploaded.  Is the AUV Portal software running on $portal_name? ***"
else
   echo "Done uploading $log_dir."
   echo " "
fi

@


1.8
log
@Put the port numer in the proper place according to the usage note for adx.
@
text
@d11 1
a11 1
# $Id: upload,v 1.7 2004/12/20 21:35:40 dorado Exp $
d16 3
a18 1
portal_name=jeckel.shore.mbari.org
d81 1
a81 1
adx_string="adx $portal_name $vc_name $vc_login $vc_pw $portal_port $survey_name $log_path/$log_dir $portal_port"
@


1.7
log
@Change to port number 9010 as that seems to be available on jeckel.
@
text
@d11 1
a11 1
# $Id: upload,v 1.6 2004/12/20 21:25:28 dorado Exp $
d79 1
a79 1
adx_string="adx $portal_name $vc_name $vc_login $vc_pw $survey_name $log_path/$log_dir $portal_port"
@


1.6
log
@Added port number for AUVPortalService.
@
text
@d11 1
a11 1
# $Id: upload,v 1.5 2004/10/11 23:49:33 dorado Exp $
d17 1
a17 1
portal_port=4443
@


1.5
log
@Added error checking at the end.
@
text
@d11 1
a11 1
# $Id: upload,v 1.4 2004/10/08 23:26:47 dorado Exp $
d14 1
a14 1
portal_name=134.89.13.120
d16 3
a18 1
echo "Missions will be sent to portal running on $portal_name."
d79 1
a79 1
adx_string="adx $portal_name $vc_name $vc_login $vc_pw $survey_name $log_path/$log_dir"
@


1.4
log
@Echo portal_name, remove existing tarball.
@
text
@d11 1
a11 1
# $Id: upload,v 1.3 2004/10/07 18:42:57 dorado Exp $
d83 9
a91 1
exec $adx_string
@


1.3
log
@Added checks for campaign name.
@
text
@d11 1
a11 1
# $Id: upload,v 1.2 2004/10/06 22:03:44 dorado Exp $
d16 1
a46 1
   echo "campaign = $campaign"
d69 8
d83 2
a84 1
`$adx_string`
@


1.2
log
@Added Campaign name capture.  Testing to auv_portal computer scyphozoan.
@
text
@d11 1
a11 1
# $Id: upload,v 1.1 2004/10/06 18:49:59 dorado Exp $
d50 5
d56 7
d66 2
a67 2
survey_name=`echo $log_dir | sed 's/\.[0-9][0-9]$//' | sed 's/\.//g'`;
##echo "survey_name = $survey_name"
@


1.1
log
@Initial checkin.  The adx_string command is commented out for now.
@
text
@d11 1
a11 1
# $Id:$
d14 2
a15 1
portal_name=auv-2-control
d26 1
a26 2
log_dir=$1
if test $log_dir
d28 1
d42 11
d63 1
a63 1
##`$adx_string`
@

