diff --git a/v2ray.php b/v2ray.php deleted file mode 100644 index 7e4f663..0000000 --- a/v2ray.php +++ /dev/null @@ -1,244 +0,0 @@ - /dev/null 2>&1"); - echo "UUID Criado: " . $UUID2 . "\n\n" . extractVmessUrlByUUID($UUID2); - } else { - echo "Error: Unable to find 'clients' array in the config file."; - } -} - - -function delv2($uuidel) -{ - $lineP = shell_exec("sed -n '/'" . $uuidel . "'/=' /etc/v2ray/config.json"); - $numl1 = 2; - $resta = $lineP - $numl1; - shell_exec("sed -i \"" . $resta . "d\" /etc/v2ray/config.json"); - shell_exec("sed -i \"" . $resta . "d\" /etc/v2ray/config.json"); - shell_exec("sed -i \"" . $resta . "d\" /etc/v2ray/config.json"); - shell_exec("sed -i \"" . $resta . "d\" /etc/v2ray/config.json"); - shell_exec("sed -i \"" . $resta . "d\" /etc/v2ray/config.json"); - shell_exec("v2ray restart > /dev/null 2>&1"); - -} - - -function dlv2($id) -{ - global $db_host, $db_port, $db_name, $db_user, $db_pass; - - -$conn = pg_connect("host=localhost dbname=dragoncore user=$db_user password=$db_pass"); - if (!$conn) { - die("Connection failed: " . pg_last_error()); - } - $query = "DELETE FROM v2ray WHERE id = $1"; - $result = pg_prepare($conn, "", $query); - if (!$result) { - die("Statement preparation failed: " . pg_last_error()); - } - $result = pg_execute($conn, "", array($id)); - if (!$result) { - die("Execution failed: " . pg_last_error()); - } - pg_close($conn); -} - - -function v2cho() -{ - $filePath = '/bin/v2ray'; - if (file_exists($filePath)) { - return "Remover"; - } else { - return "Instalar"; - } -} - - -function extractVmessUrlByUUID($uuid) -{ - $v2link = shell_exec("v2ray info | grep -A4 \"UUID: $uuid\" | tail -n1 | grep -o 'vmess://.*'"); - if (str_contains($v2link, "vmess")) { - return "$v2link"; - } else { - $v2link2 = shell_exec("v2ray info | grep -A4 \"ID: $uuid\" | tail -n1 | grep -o 'vless://.*'"); - if (str_contains($v2link2, "vless")) { - return "$v2link2"; - } else { - return null; - } - } -} \ No newline at end of file