update firewall module to use sudo ufw status properly
This re-orders the "ufw status" logic to assume it's being run as a regular user, and use "sudo /usr/sbin/ufw status". If the username is root, then instead use simply "ufw status".
This update does NOT take variable elevation commands like pbrun/dzdo/pbsudo into account. I may add that in a future update.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Why was this marked wontfix? The UFW status comes up empty on Ubuntu as a regular user without, do I need to reference an issue?
I tried testing out this PR and it hangs my WTF instance. Not sure what's going on right now but I can try to revisit sometime soon.
@FelicianoTech do you have a NOPASSWD entry in your sudoers for the ufw command? If not, it's hanging for your password
@docsmooth I did not. I would love to figure out a way to notify the user that that's the problem rather than just locking up. I don't want to hold up this PR though so that can happen latter.
Verified this works. Thank you for contributing.
@FelicianoTech that's a great point. I'll think about this, I have some thoughts