#!/bin/sh
#
# stop.sh
#
# Stop online analysis of science mode data.

# Shourov K. Chatterji
# shourov@ligo.caltech.edu

# $Id: stop.sh,v 1.2 2007/06/09 10:46:13 shourov Exp $

# change to directory containing this script
cd `dirname $0`

# path to Q transform installation
Q=../..

# setup environment
. ${Q}/bin/qsetup.sh

# analysis directory
currentDirectory=`pwd`

# temporary crontab file
crontabFile="crontab.txt"

# initialize temporary crontab file
rm -f ${crontabFile}
touch ${crontabFile}

# retrieve existing crontab
crontab -l 2>/dev/null | \
  sed -e "\|${currentDirectory}|d" \
  >>${crontabFile}

# start crontab
crontab ${crontabFile}

# remove temporary crontab file
rm ${crontabFile}

