I’m trying to get the value of the RENEWED_LINEAGE shell variable but it always returns an empty string. Here is the command I use when renewing my certificates:
I suspect you’re running into a shell-escaping problem.
The way you’ve written the command, your shell, the one you’re at when you run the command, is asked to work out the value of $RENEWED_LINEAGE and substitute it. It has no value for this variable, so the file is blank.
If you write a little shell script, which does this work, and then call that from the command, the shell script will look at its own environment’s $RENEWED_LINEAGE, which will have been set up by the renew hook, so it should work. If you really don’t want to write a shell script, you can also escape the variable so that it is only evaluated later, by writing something like $RENEWED_LINEAGE although exactly how the escaping needs to look may vary depending on your choice of shell.