mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-29 06:18:08 +02:00
Removed unnecessary scripts
This commit is contained in:
parent
3f618037ad
commit
c03241c1fc
2 changed files with 0 additions and 17 deletions
|
@ -33,11 +33,6 @@ namespace MTWireGuard.Application
|
|||
return $"/tool fetch mode=http url=\"{apiURL}\" http-method=post check-certificate=no http-data=([/interface/wireguard/peers/print show-ids proplist=rx,tx as-value]);";
|
||||
}
|
||||
|
||||
public static string PeersLastHandshakeScript(string apiURL)
|
||||
{
|
||||
return $"/tool fetch mode=http url=\"{apiURL}\" http-method=post check-certificate=no http-data=([/interface/wireguard/peers/print show-ids proplist=last-handshake as-value]);";
|
||||
}
|
||||
|
||||
public static int ParseEntityID(string entityID)
|
||||
{
|
||||
return Convert.ToInt32(entityID[1..], 16);
|
||||
|
|
|
@ -57,7 +57,6 @@ namespace MTWireGuard.Application
|
|||
var scripts = await api.GetScripts();
|
||||
var schedulers = await api.GetSchedulers();
|
||||
var trafficScript = scripts.Find(x => x.Name == "SendTrafficUsage");
|
||||
var handshakeScript = scripts.Find(x => x.Name == "SendActivityUpdates");
|
||||
var trafficScheduler = schedulers.Find(x => x.Name == "TrafficUsage");
|
||||
|
||||
if (trafficScript == null)
|
||||
|
@ -71,17 +70,6 @@ namespace MTWireGuard.Application
|
|||
});
|
||||
var result = create.Code;
|
||||
}
|
||||
if (handshakeScript == null)
|
||||
{
|
||||
var create = await api.CreateScript(new()
|
||||
{
|
||||
Name = "SendActivityUpdates",
|
||||
Policies = ["write", "read", "test"],
|
||||
DontRequiredPermissions = false,
|
||||
Source = Helper.PeersLastHandshakeScript($"http://{ip}/api/activity")
|
||||
});
|
||||
var result = create.Code;
|
||||
}
|
||||
if (trafficScheduler == null)
|
||||
{
|
||||
var create = await api.CreateScheduler(new()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue