#!/bin/bash

# Needs ncbi-entrez-direct
efetch -db nuccore -id CP014688.1 -format fasta | head -n175 > example.fasta
mkdir -p data

if [ -f data/example.fasta ]
then
diff -u example.fasta data/example.fasta

if [ `echo $?` -ne 0 ]
then
	echo "The data has changed, injecting new data, please check manually before upload"
else
	echo "The data is same, no changes needed"
fi
fi

mv example.fasta data/example.fasta

echo "Done"
