I have a bash script with multiple commands :
code <<-EOH
yum -y install httpd && yum -y install mod_ssl
cd /tmp
git clone https://github.xxx
cd /tmp/docker-oidc-rp
cp modules/centos/x86_64/apache22/mod_wsja.cl2.so /etc/httpd/modules
cp int/ce-conf/*.* /etc/httpd/conf/mod_mon-ce
echo "Include /etc/httpd/conf/mod_mon-ce/wsjacl2.conf" >> /etc/httpd/conf/httpd.conf
echo "modmon recipe executed successfully"
EOH
now I have multiple commands which I want to run in order and if they fail then I want to exit the bash with a failure message/error but even if a command fails , it moves to other commands and then gives a success message for bash.
Whats the most concise method to make all commands wait for preceding commands to succeed and exit out of bash if anything fails with error.