Improvement the ir_script.sh with more environment variables