Update sPhone.lua
This commit is contained in:
parent
fcfd446832
commit
2265ec075a
1 changed files with 18 additions and 11 deletions
|
@ -122,6 +122,13 @@ local function kernel()
|
|||
f.close()
|
||||
end
|
||||
|
||||
if not fs.exists("/.sPhone/config/newPassword") and fs.exists("/.sPhone/.password") then
|
||||
fs.move("/.sPhone/.password","/.sPhone/config/.password")
|
||||
f = fs.open("/.sPhone/config/newPassword","w")
|
||||
f.write("Ignore Me. I just check if the password is moved to the config folder")
|
||||
f.close()
|
||||
end
|
||||
|
||||
if not fs.exists("/.sPhone/autorun") then
|
||||
fs.makeDir("/.sPhone/autorun")
|
||||
end
|
||||
|
@ -693,7 +700,7 @@ end
|
|||
term.setTextColor(colors.black)
|
||||
local passwordLogin = read("*")
|
||||
term.redirect(sPhone.mainTerm)
|
||||
local fpw = fs.open("/.sPhone/.password","r")
|
||||
local fpw = fs.open("/.sPhone/config/.password","r")
|
||||
if sha256.sha256(passwordLogin) == fpw.readLine() then
|
||||
sPhone.wrongPassword = false
|
||||
home()
|
||||
|
@ -742,7 +749,7 @@ end
|
|||
local password2 = read("*")
|
||||
term.redirect(sPhone.mainTerm)
|
||||
if password1 == password2 then
|
||||
local f = fs.open("/.sPhone/.password", "w")
|
||||
local f = fs.open("/.sPhone/config/.password", "w")
|
||||
f.write(sha256.sha256(password1))
|
||||
f.close()
|
||||
term.setTextColor(colors.lime)
|
||||
|
|
Loading…
Reference in a new issue