Bash script to update main index