From bc294508b9d6566add6605bb7da09d3f6b74f9bb Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 15 Jul 2019 13:12:04 -0400 Subject: Corrections and new API! --- system/post-setup.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'system/post-setup.lua') diff --git a/system/post-setup.lua b/system/post-setup.lua index 1e6bfe0..9ff14d6 100644 --- a/system/post-setup.lua +++ b/system/post-setup.lua @@ -38,12 +38,18 @@ print("Welcome to the bits-UI Post Setup!") sleep(2) print("Please enter your password.") print("(Don't set your real password in servers.)") + local passPath = "/etc/passwd.pwd" -local passwd = read(" ") -local insertPasswd = fs.open(passPath, "a") -insertPasswd.writeLine(passwd) -insertPasswd.close() -print("Thanks, I will save that.") +if fs.exists(passPath) then + print("[INFO] Password file exists! Skipping.") + sleep(2) +else + local passwd = read(" ") + local insertPasswd = fs.open(passPath, "a") + insertPasswd.writeLine(passwd) + insertPasswd.close() + print("Thanks, I will save that.") +end sleep(1) shell.run("/system/desktop.lua") \ No newline at end of file -- cgit v1.2.3