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:
@@ -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
|
||||
|
@@ -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.
@@ -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",
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user