.
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.")
|
||||
write("Input: ")
|
||||
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()
|
||||
end
|
||||
|
||||
if not fs.exists "brulijam/files/networking-key.txt" then
|
||||
if not fs.exists "brulijam/config/networking-key.txt" then
|
||||
createKeyfile()
|
||||
end
|
@ -9,19 +9,19 @@ function createKeyfile()
|
||||
print("[NETWORKING]")
|
||||
write("Please enter shared secret for networking: ")
|
||||
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()
|
||||
end
|
||||
|
||||
local function getKeyfile()
|
||||
local pwHash = basic.readFileOneline("brulijam/files/networking-key.txt")
|
||||
local pwHash = basic.readFileOneline("brulijam/config/networking-key.txt")
|
||||
return pwHash
|
||||
end
|
||||
|
||||
local function setup()
|
||||
ownLabel = os.computerLabel()
|
||||
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()
|
||||
shell.run("/brulijam/lib/createNetworkingKey.lua")
|
||||
end
|
||||
|
@ -61,10 +61,11 @@ shell.run("/brulijam/setLabel.lua")
|
||||
--create networking key
|
||||
shell.run("/brulijam/lib/createNetworkingKey.lua")
|
||||
|
||||
--shell.run("/brulijam/systemlock.lua")
|
||||
shell.run("/brulijam/systemlock.lua")
|
||||
|
||||
|
||||
--you shall not pass systemlock
|
||||
--os.reboot()
|
||||
os.reboot()
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user