I need to check the output of apachectl configtest in a bash script and restart if everything looks good without outputting the command to the screen
var =sudo apachectl configtest
If var contains "Syntax OK" then
sudo apachectl graceful
How to do it?
>to save the command output to a file like so:[command] > [filepath]apachectl gracefulautomatically runs configtest before restarting, according to the documentation.configtestfails.