Closed FelipeEsBr closed 4 years ago
So I'm not very familiar with ufw and how it works/behaves, it's off by default on most Ubunutu/Debian installs I've ran. I checked my Ubuntu 18.04 and when I run sudo ufw status
I get Status: inactive
Would something like this fix it?
if [[ $(ufw status | grep inactive | wc -l) -eq 0 ]]; then
ufw allow 8080 comment 'tomcat allowed'
fi
I don't know enough about ufw to know if that's a "universal fix" that I should include here.
Edit, actually I should probably make sure it's a valid command first so:
if [ -x "$( command -v ufw )" ]; then
if [[ $(ufw status | grep inactive | wc -l) -eq 0 ]]; then
ufw allow 8080/tcp comment 'tomcat allowed'
fi
fi
2nd Edit: This should be TCP only fixed ^
ufw allow 8080 comment 'tomcat allowed'