LATEST_HASH=$(git rev-parse --short HEAD)
is the more normal way to do that.
It also looks like you'll have downtime due to deleting then running. Eww.