diff --git a/src/iptables/main.php b/src/iptables/main.php index 986db03..c8cf545 100644 --- a/src/iptables/main.php +++ b/src/iptables/main.php @@ -10,37 +10,37 @@ } else if ($_GET['action'] === 'check') { $iptables_file = file_get_contents($_SERVER['IPTABLES_PATH']); if (!$iptables_file) { - die('ERROR: config not found'); + die("ERROR: config not found\n"); } $theword = "-A OUTPUT -m owner --uid-owner $_GET[user] -j REJECT\n"; die(str_contains($iptables_file, $theword) ? '1' : '0'); } else if ($_GET['action'] === 'add_user') { $iptables_file = file_get_contents($_SERVER['IPTABLES_PATH']); if (!$iptables_file) { - die('ERROR: config not found'); + die("ERROR: config not found\n"); } $theword = "-A OUTPUT -m owner --uid-owner $_GET[user] -j REJECT\n"; $replaced_file = str_replace($theword, "", $iptables_file); $replaced_file = str_replace("# Limiter goes down here\n", "# Limiter goes down here\n".$theword, $replaced_file); if ($iptables_file === $replaced_file) { - die('Updated, nothing changed'); + die("Updated, nothing changed\n"); } if (file_put_contents($_SERVER['IPTABLES_PATH'], $replaced_file, LOCK_EX) === false) { - die('ERROR: unable to write config'); + die("ERROR: unable to write config\n"); } exec($_SERVER['IPTABLES_RELOAD']); echo "Updated for IPv4\n"; } else if ($_GET['action'] === 'del_user') { $iptables_file = file_get_contents($_SERVER['IPTABLES_PATH']); if (!$iptables_file) { - die('ERROR: config not found'); + die("ERROR: config not found\n"); } $replaced_file = str_replace("-A OUTPUT -m owner --uid-owner $_GET[user] -j REJECT\n", "", $iptables_file); if ($iptables_file === $replaced_file) { - die('Updated, Nothing changed'); + die("Updated, Nothing changed\n"); } if (file_put_contents($_SERVER['IPTABLES_PATH'], $replaced_file, LOCK_EX) === false) { - die('ERROR: unable to write config'); + die("ERROR: unable to write config\n"); } exec($_SERVER['IPTABLES_RELOAD']); echo "Updated for IPv4\n"; diff --git a/src/iptables/mainv6.php b/src/iptables/mainv6.php index 67f0e3d..080af38 100644 --- a/src/iptables/mainv6.php +++ b/src/iptables/mainv6.php @@ -10,30 +10,30 @@ } else if ($_GET['action'] === 'add_user') { $iptables_file = file_get_contents($_SERVER['IPTABLESV6_PATH']); if (!$iptables_file) { - die('ERROR: config not found'); + die("ERROR: config not found\n"); } $theword = "-A OUTPUT -m owner --uid-owner $_GET[user] -j REJECT\n"; $replaced_file = str_replace($theword, "", $iptables_file); $replaced_file = str_replace("# Limiter goes down here\n", "# Limiter goes down here\n" . $theword, $replaced_file); if ($iptables_file === $replaced_file) { - die('Updated, nothing changed'); + die("Updated, nothing changed\n"); } if (file_put_contents($_SERVER['IPTABLESV6_PATH'], $replaced_file, LOCK_EX) === false) { - die('ERROR: unable to write config'); + die("ERROR: unable to write config\n"); } exec($_SERVER['IPTABLESV6_RELOAD']); echo "Updated for IPv6\n"; } else if ($_GET['action'] === 'del_user') { $iptables_file = file_get_contents($_SERVER['IPTABLESV6_PATH']); if (!$iptables_file) { - die('ERROR: config not found'); + die("ERROR: config not found\n"); } $replaced_file = str_replace("-A OUTPUT -m owner --uid-owner $_GET[user] -j REJECT\n", "", $iptables_file); if ($iptables_file === $replaced_file) { - die('Updated, Nothing changed'); + die("Updated, Nothing changed\n"); } if (file_put_contents($_SERVER['IPTABLESV6_PATH'], $replaced_file, LOCK_EX) === false) { - die('ERROR: unable to write config'); + die("ERROR: unable to write config\n"); } exec($_SERVER['IPTABLESV6_RELOAD']); echo "Updated for IPv6\n";