#!/bin/sh
if [ -f running ]
then
 ID=`cat running`
 FINISHED=`squeue --jobs $ID | grep mark`
 if [ "$FINISHED" == "" ]
 then 
  if [ -f aborting ]
  then
   exit 0
  fi
  if [ -f finished ]
  then
   exit 0
  else
   exit 0
  fi
 else
  exit 1
 fi
else
 exit 1
fi
