This commit is contained in:
2025-04-07 12:16:11 +01:00
parent ce8b201a1c
commit e15a80163b
62 changed files with 149 additions and 131 deletions

View File

@@ -36,21 +36,21 @@ class FirewallRule extends Model
public function command(bool $delete = false): string
{
$command = "ufw";
$command = 'ufw';
if ($delete) {
$command .= " delete";
$command .= ' delete';
}
if ($this->type === 'allow') {
$command .= " allow";
$command .= ' allow';
} elseif ($this->type === 'deny') {
$command .= " deny";
$command .= ' deny';
}
if ($this->from) {
$command .= " from {$this->from}";
$command .= " to any port";
$command .= ' to any port';
}
$command .= " {$this->ports}";