Removed unnecessary scripts

This commit is contained in:
Tech Garage 2024-01-26 14:25:37 +03:30
parent 3f618037ad
commit c03241c1fc
2 changed files with 0 additions and 17 deletions

View file

@ -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);

View file

@ -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()