I need to open port 80 for certbot renewal, so I am trying to use pre-hook and post-hook features of certbot. I can easily script adding a UFW rule to open port 80, but when I try to delete that rule (to close port 80 back up again), UFW insists on operating interactively, asking if I want to continue, so the rule deletion gets aborted.
How can I pass a "Y" to the "UFW delete rulenumber" command so it doesnt get aborted? I have tried -y and /y but doesnt seem to work.
Ubuntu 16.04 and 18.04 BTW....
11 Answer
Figgered it out.
yes | ufw delete 1works.....