1
0
mirror of https://github.com/AR2000AR/openComputers_codes.git synced 2025-09-04 12:45:58 +02:00

[icable] does not close tunnel when called without args

This commit is contained in:
2024-02-18 21:41:26 +01:00
parent 9f35457966
commit 7bc97632ca
5 changed files with 8 additions and 7 deletions

View File

@@ -5,10 +5,7 @@ local shell = require('shell')
local os = require('os')
local term = require("term")
if (network.interfaces['tun0']) then
network.interfaces['tun0'].ethernet --[[@as IcableDataLayer]]:close()
end
local args, opts = shell.parse(...)
local args, opts = shell.parse(...)
if (#args ~= 1 or opts.h) then
print('icable [--c=][--p=][--u=][--k] CIDR')
print('\t--c : Server address')
@@ -38,7 +35,11 @@ if (not opts.k) then
term.write("\n")
end
if (network.interfaces['tun0']) then
network.interfaces['tun0'].ethernet --[[@as IcableDataLayer]]:close()
end
local interface, reason = icable.connect(opts.u, opts.k, opts.c, opts.p, ipv4address.fromCIDR(args[1]))
if (not interface) then
print(reason)
else

View File

@@ -1,7 +1,7 @@
{
["manifestVersion"] = "1.0",
["package"] = "icable",
["version"] = "0.1.1",
["version"] = "0.1.2",
["name"] = "icable",
["repo"] = "tree/master/icable",
["description"] = "Use the internet card instead of the network card with osinetwork",

Binary file not shown.

View File

@@ -161,7 +161,7 @@
["icable"] = {
["manifestVersion"] = "1.0",
["package"] = "icable",
["version"] = "0.1.1",
["version"] = "0.1.2",
["name"] = "icable",
["repo"] = "tree/master/icable",
["description"] = "Use the internet card instead of the network card with osinetwork",

View File

@@ -166,7 +166,7 @@
}
},
["icable"] = {
version = "0.1.1",
version = "0.1.2",
name = "icable",
repo = "tree/master/icable",
description = "Use the internet card instead of the network card with osinetwork",