1
0
mirror of https://github.com/kepler155c/opus synced 2024-11-15 13:14:49 +00:00
opus/sys/autorun/welcome.lua

52 lines
1.2 KiB
Lua
Raw Normal View History

local Config = require('opus.config')
local Util = require('opus.util')
2019-01-20 03:05:05 +00:00
local fs = _G.fs
2019-06-28 10:33:47 +00:00
local os = _G.os
local shell = _ENV.shell
2019-01-20 03:05:05 +00:00
local config = Config.load('os')
2019-06-29 12:50:11 +00:00
if not config.welcomed then
2019-06-18 19:19:24 +00:00
config.welcomed = true
config.securityUpdate = true
config.readNotes = 1
2019-06-18 19:19:24 +00:00
Config.update('os', config)
2019-06-29 12:50:11 +00:00
if shell.openForegroundTab then
shell.openForegroundTab('Welcome')
end
2019-01-20 03:05:05 +00:00
end
if not config.securityUpdate then
config.securityUpdate = true
config.secretKey = nil
config.password = nil
config.readNotes = 1
Config.update('os', config)
fs.delete('usr/.known_hosts')
Util.writeFile('sys/notes_1.txt', [[
An important security update has been applied.
Unfortunately, this update has reset the
password on the system. You can set a new
password in System->System->Password.
All computers that you connect to will also
need to be updated as well.
2019-06-29 12:50:11 +00:00
Also, I have changed the location for apis.
This will require you to update all installed
packages. Sorry !
Thanks for your patience. And... thanks to
Anavrins for the much improved security.
2019-06-29 12:50:11 +00:00
]])
end
if fs.exists('sys/notes_1.txt') and shell.openForegroundTab then
shell.openForegroundTab('edit sys/notes_1.txt')
os.sleep(2)
fs.delete('sys/notes_1.txt')
end