This commit is contained in:
Julian Brammer 2024-06-09 18:11:42 +02:00
parent e7f5217614
commit 213ba4ab55
3 changed files with 8 additions and 7 deletions

View File

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

View File

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

View File

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