aboutsummaryrefslogtreecommitdiff
path: root/system/reset.lua
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@gmail.com>2019-03-06 15:04:04 -0500
committerAndrew Lee <alee14498@gmail.com>2019-03-06 15:04:04 -0500
commit34e25ebda57a7f5a4f28d0ff923ae27daf5c68b2 (patch)
tree1e1e4ef27a885e8602ab9941e7b98a16f3aa0d8a /system/reset.lua
parentab94bab7e3d45b58084388b0cd5d247790a00005 (diff)
downloadbits-UI-34e25ebda57a7f5a4f28d0ff923ae27daf5c68b2.tar.gz
bits-UI-34e25ebda57a7f5a4f28d0ff923ae27daf5c68b2.tar.bz2
bits-UI-34e25ebda57a7f5a4f28d0ff923ae27daf5c68b2.zip
Another big change!
Diffstat (limited to 'system/reset.lua')
-rw-r--r--system/reset.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/system/reset.lua b/system/reset.lua
new file mode 100644
index 0000000..9b8efb4
--- /dev/null
+++ b/system/reset.lua
@@ -0,0 +1,36 @@
+--[[
+ bits-UI Reset Script: A script that will wipe the system to the default factory settings.
+ Copyright (C) 2019 Alee14
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+]]--
+function clear()
+ term.clear()
+ term.setCursorPos(1,1)
+ term.setTextColor(colors.white)
+end
+clear()
+print("Are you sure you want to reset bits-UI? (y/n)")
+local input = read()
+if input == "y" then
+ print("Erasing all user stored data...")
+ fs.delete("/home")
+ fs.delete("/etc/passwd.pwd")
+ sleep(2)
+ print("Erased all data...")
+ sleep(2)
+ print("Rebooting...")
+ sleep(3)
+ os.reboot()
+else
+ shell.run("startup.lua")
+end \ No newline at end of file