When performing an automated server deployment, I can upload and import gpg keys via script. But I cannot trust keys.
I tried
gpg --batch --yes --edit-key keyname trust 5
and
echo 5 | gpg --batch --yes --edit-key keyname trust -
In non-batch mode it always stops to ask for input. In batch mode it ignores input.
What is the correct syntax?