Add test mode to bash script