From 136a2268ead4dbd4bd3952a76588f256b504fbcd Mon Sep 17 00:00:00 2001 From: Martin Mose Facondini Date: Wed, 3 Sep 2025 18:42:58 +0200 Subject: [PATCH] refactor: pr feedback - ufw --- migrations/1756911131.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/migrations/1756911131.sh b/migrations/1756911131.sh index c7e9cd5..6747ab0 100755 --- a/migrations/1756911131.sh +++ b/migrations/1756911131.sh @@ -1,13 +1,11 @@ echo "Enable UFW systemd service for existing installations" -# Check if UFW is installed and configured but systemd service not enabled -if command -v ufw >/dev/null 2>&1; then - # Check if UFW has rules configured (indicating it was set up by Omarchy) - if sudo ufw status | grep -q "Status: active\|22/tcp\|53317"; then - # Enable UFW systemd service if not already enabled - if ! systemctl is-enabled ufw >/dev/null 2>&1; then - sudo systemctl enable ufw - echo "UFW systemd service enabled" +if omarchy-cmd-present ufw; then + if sudo ufw status | grep -q "Status: active\|22/tcp\|53317"; then + if ! systemctl is-enabled ufw >/dev/null 2>&1; then + sudo systemctl enable ufw --now + echo "UFW systemd service enabled" + fi fi - fi -fi \ No newline at end of file +fi +