We really need better error messaging. Whenever there is an issue like Error: apache2 restart failed
I have to go scrambling to find the issue root, plowing through logs and xtracing the script.
If not all relevant commands were silenced, this could often be sped up a lot. For example my recent xtrace led me to the failing command, which gave a clear error:
> sudo apache2ctl configtest
AH00526: Syntax error on line 30 of /etc/apache2/conf.d/domains/DOMAIN.ssl.conf:
SSLCertificateFile: file '/home/reitershan/conf/web/DOMAIN/ssl/DOMAIN.crt' does not exist or is empty
Why do you redirect all output away, rather than letting the relevant commands print their output?