.
This commit is contained in:
parent
e7f5217614
commit
213ba4ab55
@ -10,10 +10,10 @@ function createKeyfile()
|
|||||||
print("This will be used to communicate with other Devices and should be the same on different Turtles and Computers that you want to be connected.")
|
print("This will be used to communicate with other Devices and should be the same on different Turtles and Computers that you want to be connected.")
|
||||||
write("Input: ")
|
write("Input: ")
|
||||||
local pwHash = hash.digestStr(read("*") .. "salty salt")
|
local pwHash = hash.digestStr(read("*") .. "salty salt")
|
||||||
basic.writeToFile("brulijam/files/networking-key.txt", pwHash)
|
basic.writeToFile("brulijam/config/networking-key.txt", pwHash)
|
||||||
basic.clearDisplay()
|
basic.clearDisplay()
|
||||||
end
|
end
|
||||||
|
|
||||||
if not fs.exists "brulijam/files/networking-key.txt" then
|
if not fs.exists "brulijam/config/networking-key.txt" then
|
||||||
createKeyfile()
|
createKeyfile()
|
||||||
end
|
end
|
@ -9,19 +9,19 @@ function createKeyfile()
|
|||||||
print("[NETWORKING]")
|
print("[NETWORKING]")
|
||||||
write("Please enter shared secret for networking: ")
|
write("Please enter shared secret for networking: ")
|
||||||
local pwHash = hash.digestStr(read("*") .. "salty salt")
|
local pwHash = hash.digestStr(read("*") .. "salty salt")
|
||||||
basic.writeToFile("brulijam/files/networking-key.txt", pwHash)
|
basic.writeToFile("brulijam/config/networking-key.txt", pwHash)
|
||||||
basic.clearDisplay()
|
basic.clearDisplay()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getKeyfile()
|
local function getKeyfile()
|
||||||
local pwHash = basic.readFileOneline("brulijam/files/networking-key.txt")
|
local pwHash = basic.readFileOneline("brulijam/config/networking-key.txt")
|
||||||
return pwHash
|
return pwHash
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setup()
|
local function setup()
|
||||||
ownLabel = os.computerLabel()
|
ownLabel = os.computerLabel()
|
||||||
peripheral.find("modem", rednet.open)
|
peripheral.find("modem", rednet.open)
|
||||||
if not fs.exists "brulijam/files/networking-key.txt" then
|
if not fs.exists "brulijam/config/networking-key.txt" then
|
||||||
--createKeyfile()
|
--createKeyfile()
|
||||||
shell.run("/brulijam/lib/createNetworkingKey.lua")
|
shell.run("/brulijam/lib/createNetworkingKey.lua")
|
||||||
end
|
end
|
||||||
|
@ -61,10 +61,11 @@ shell.run("/brulijam/setLabel.lua")
|
|||||||
--create networking key
|
--create networking key
|
||||||
shell.run("/brulijam/lib/createNetworkingKey.lua")
|
shell.run("/brulijam/lib/createNetworkingKey.lua")
|
||||||
|
|
||||||
--shell.run("/brulijam/systemlock.lua")
|
shell.run("/brulijam/systemlock.lua")
|
||||||
|
|
||||||
|
|
||||||
--you shall not pass systemlock
|
--you shall not pass systemlock
|
||||||
--os.reboot()
|
os.reboot()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user