added installer and stuff

This commit is contained in:
2024-02-22 19:00:25 +01:00
parent 33de2b1b60
commit f0b30bb7c3
3 changed files with 36 additions and 3 deletions

32
installer.lua Normal file
View File

@@ -0,0 +1,32 @@
local greetingText = "Dieser Installer begleitet Sie für wenige Sekunden bei der Installation eines sehr coolen Programmes. Bitte tun Sie, was das Programm sagt, sonst wird es sauer."
local headerText = "PowerManager - Installer\n"
local startOnBootText = "Beim Boot ausführen?"
local automaticUpdateText = "Automatisch updates herunterladen?"
--returns the user input as bool (Y/N) -> (1/0)
local function askThatDamnUser(prompt)
while true do
print(">>> " .. prompt)
local userInput = term.read()
if userInput == "Y\n" then
return true
elseif userInput == "N\n" then
return false
else
print("Hallo? => ( Y / N ) Nicht -> " .. userInput)
end
end
end
local startOnBoot = askThatDamnUser(startOnBootText)
local automaticUpdate = askThatDamnUser(automaticUpdateText)
if startOnBoot then
print("notImplementedYet")
end
if automaticUpdate then
print("notImplementedYet")
end
os.execute("mv shortcut.lua /usr/bin/powerman")

1
shortcut.lua Normal file
View File

@@ -0,0 +1 @@
dofile("/home/PowerManager/updater.lua")

View File

@@ -1,10 +1,10 @@
print("Updaten? (Y/*)") print("Updaten? (Y/*)")
local abfrage = term.read() local abfrage = io.read()
if abfrage == "Y" then if abfrage == "Y\n" then
print("Ja!") print("Ja!")
--os.execute("gitrepo seesberger/PowerManager /home/PowerManager") os.execute("gitrepo seesberger/PowerManager /home/PowerManager")
else else
print("Nein!") print("Nein!")
os.sleep(1) os.sleep(1)