Fixing problem with already existing tags

I had a problem with my sync, since there were errors with already existing tags.
I fixed the problem according to some hints from
  http://stackoverflow.com/questions/17790123/shell-script-trying-to-validate-if-a-git-tag-exists-in-a-git-repository-in-an

So now the tag is only done if it does not already exist.
However, egrep must be installed for this to work (can this be added as dependency somewhere)?