#!/bin/bash

#This script ochestrates the speech filtering and upload process. It only permits both processes to begin only if none of them is currently running.
#Run in crontab at desired intervals. the closer the intervals, the closer to semi-live streaming the system gets

file1="/home/radio/radio/new_scripts/speechness_filter.sh"
file2="/home/radio/radio/new_scripts/upload_new.sh"
#echo $(lsof $file)
if [ $( lsof $file1 | wc -l) -eq 0 -a $( lsof $file2 | wc -l) -eq 0 ]
then
	echo $(date)
	bash $file1 "/home/radio/radio/recordings/" &
	bash $file2 &
	#exit 1
else
	echo "file in use"
fi
echo "done"


