In one line of bash, how do I return an exit status of 0 when the output of /usr/local/bin/monit --version doesn\'t contain exactly 5.5 and an exit
/usr/local/bin/monit --version
5.5
Test the return value of grep:
sudo service xyz status | grep 'not' &> /dev/null if [ $? == 0 ]; then echo "whateveryouwant" fi
I would recommend cron, it works fine with SALT stack