fix the bash script for ami deployment