Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update()
- --for a later date
- end
- function recoverAll()
- --delete all folders and files (except recovery, that is)
- fs.delete(funcPath)
- fs.delete(regPath)
- fs.delete(sysPath .. "main")
- fs.delete(sysPath .. "ui")
- fs.delete(usrPath)
- fs.delete(prgPath)
- fs.delete(rootPath .. "params")
- fs.delete(rootPath .. "startup")
- fs.delete(prgPath .. "calcPlus")
- fs.delete(prgPath .. "luaIDE")
- fs.delete(prgPath .. "ink")
- --recreate the folder structure
- fs.makeDir(osFilesPath)
- fs.makeDir(sysPath)
- fs.makeDir(funcPath)
- fs.makeDir(regPath)
- fs.makeDir(usrPath)
- fs.makeDir(usrPath .. "Admin")
- fs.makeDir(prgPath)
- if not fs.exists(prgPath) then
- fs.makeDir(prgPath)
- end
- --recreate the files
- fs.copy(restPath .. "cred", funcPath .. "cred")
- --fs.copy(restPath .. "debug", funcPath .. "debug")
- fs.copy(restPath .. "func", funcPath .. "func")
- fs.copy(restPath .. "periph", funcPath .. "periph")
- fs.copy(restPath .. "prg", regPath .. "prg")
- --fs.copy(restPath .. "settings", regPath .. "settings")
- fs.copy(restPath .. "usr", regPath .. "usr")
- fs.copy(restPath .. "main", sysPath .. "main")
- fs.copy(restPath .. "ui", sysPath .. "ui")
- fs.copy(restPath .. "Aset", usrPath .. "Admin/settings")
- fs.copy(restPath .. "startup", rootPath .. "startup")
- fs.copy(restPath .. "params", rootPath .. "params")
- fs.copy(restPath .. "luaIDE", prgPath .. "luaIDE")
- fs.copy(restPath .. "calcPlus", prgPath .. "calcPlus")
- fs.copy(restPath .. "ink", prgPath .. "ink")
- os.reboot()
- end
- function recoverSys()
- --delete system folders and files
- fs.delete(funcPath)
- fs.delete(regPath)
- fs.delete(sysPath .. "main")
- fs.delete(sysPath .. "ui")
- fs.delete(rootPath .. "startup")
- fs.delete(rootPath .. "params")
- fs.delete(prgPath .. "calcPlus")
- fs.delete(prgPath .. "luaIDE")
- fs.delete(prgPath .. "ink")
- --recreate folder structure
- fs.makeDir(funcPath)
- fs.makeDir(regPath)
- if not fs.exists(prgPath) then
- fs.makeDir(prgPath)
- end
- --recreate the files
- fs.copy(restPath .. "main", sysPath .. "main")
- fs.copy(restPath .. "ui", sysPath .. "ui")
- fs.copy(restPath .. "startup", rootPath .. "startup")
- fs.copy(restPath .. "params", rootPath .. "params")
- fs.copy(restPath .. "luaIDE", prgPath .. "luaIDE")
- fs.copy(restPath .. "calcPlus", prgPath .. "calcPlus")
- fs.copy(restPath .. "ink", prgPath .. "ink")
- os.reboot()
- end
- function recover(arg)
- if arg == 1 then
- recoverSys()
- elseif arg == 2 then
- recoverAll()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement