This commit is contained in:
devdatt 2025-12-27 17:43:17 +05:30
parent 40b3e262f7
commit 7b4943947e
1 changed files with 1 additions and 3 deletions

View File

@ -46,13 +46,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
array_map('trim', explode(',', (string)$value)),
'strlen'
);
error_log("tmp count is " . count($tmp));
if (count($tmp) !== 0) {
if (count($tmp) > 0) {
foreach ($tmp as $ip) {
exec("sudo ufw allow from " . $ip . "to any port " . $port . " proto tcp");
}
} else {
error_log("allow all port " . $port);
exec("sudo ufw allow " . $port);
}
}