Renew Script with if and email

There are a number of options. 0.5.0 introduced hooks which are called when certificates are renewed:

You could also inspect the output of of the renew run and use that to determine your action. For example:

OUT=$(/path/to/letsencrypt-auto renew)
if [ $? -eq 0 ]; then
	if grep -q "Congratulations!" <<<$OUT; then
		# certificates renewed successfully
	else
		# certificates not due for renewal
	fi
else
	# error during renewal
fi
1 Like