How to automatically renew certificates?

Shouldn’t that be || rather than &&, as in

... /bin/grep -q 'No renewals were attempted.' || { /usr/sbin/nginx ...

The grep will succeed only if there was no renewals done, so only restart nginx when it isn’t needed.