Moved hook bash script to template file