Commit ea78e8f9 authored by tywldx's avatar tywldx

fix

parent 9cc2cfa7
...@@ -75,7 +75,7 @@ admin.post('/add_new_proxy', function (req, res) { ...@@ -75,7 +75,7 @@ admin.post('/add_new_proxy', function (req, res) {
let newstr = "",sourcestr; let newstr = "",sourcestr;
if( index != -1 ){ if( index != -1 ){
//存在这个配置,判断是否是原有的IP //存在这个配置,判断是否是原有的IP
var reg = new RegExp(request["namespace"] + "\\|\\d*\\.\\d*\\.\\d*\\.\\d*"); var reg = new RegExp(request["namespace"] + "\\|\\d*\\.\\d*\\.\\d*\\.\\d*|\S*");
try{ try{
sourcestr = str.match(reg); sourcestr = str.match(reg);
sourcestr = sourcestr[0] sourcestr = sourcestr[0]
...@@ -110,7 +110,7 @@ admin.post('/add_new_proxy', function (req, res) { ...@@ -110,7 +110,7 @@ admin.post('/add_new_proxy', function (req, res) {
} }
newstr = newstr.replace(/\n/,""); newstr = newstr.replace(/\n/,"");
execSync(`echo "${newstr}" > ../ngrok/docker_env_name.sh`) execSync(`echo "${newstr}" > ../ngrok/docker_env_name.sh`)
cproc.exec("../ngrok/make_frp_ini.sh"); cproc.exec("../ngrok/make_frp_ini_V2.sh");
res.send({msg:"执行完成"}); res.send({msg:"执行完成"});
}); });
...@@ -118,7 +118,7 @@ admin.post('/remove_proxy', function (req, res) { ...@@ -118,7 +118,7 @@ admin.post('/remove_proxy', function (req, res) {
let request = req.body; let request = req.body;
var str = String(execSync(`cat ../ngrok/docker_env_name.sh`)).replace(/\n/,""); var str = String(execSync(`cat ../ngrok/docker_env_name.sh`)).replace(/\n/,"");
var sourcestr; var sourcestr;
var reg = new RegExp(request["namespace"] + "\\|\\d*\\.\\d*\\.\\d*\\.\\d*"); var reg = new RegExp(request["namespace"] + "\\|\\d*\\.\\d*\\.\\d*\\.\\d*|\S*");
try{ try{
sourcestr = str.replace(reg,""); sourcestr = str.replace(reg,"");
}catch(e){ }catch(e){
...@@ -126,7 +126,7 @@ admin.post('/remove_proxy', function (req, res) { ...@@ -126,7 +126,7 @@ admin.post('/remove_proxy', function (req, res) {
return return
} }
execSync(`echo "${sourcestr}" > ../ngrok/docker_env_name.sh`); execSync(`echo "${sourcestr}" > ../ngrok/docker_env_name.sh`);
cproc.exec("../ngrok/make_frp_ini.sh"); cproc.exec(`../ngrok/remove.sh ${request["namespace"]}`);
res.setHeader("Content-Type","application/json"); res.setHeader("Content-Type","application/json");
var str = execSync(`cat ../ngrok/docker_env_name.sh`) var str = execSync(`cat ../ngrok/docker_env_name.sh`)
......
#!/bin/bash
nginxname="/usr/local/openresty/nginx/conf/conf.d"
rm -rf $nginxname/$1.conf
nginx -s reload
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment