-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer
47 lines (25 loc) · 956 Bytes
/
installer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--run this program to install the up to date cloud service, after that you can remove it
print("installing cloud")
if fs.exists("/cloud") and fs.exits("/cloudDir") then
print("you already have the cloud installed, you dont need to install it again, the program wil update itself")
return
end
print("downloading")
response1 = http.get("https://raw.github.com/oedze/cloud/master/client")
response2 = http.get("https://raw.github.com/oedze/cloud/master/cloud_client")
response3 = http.get("https://raw.github.com/oedze/cloud/master/encrypt")
print("installing")
fileData1 = response1.readAll()
fileData2 = response2.readAll()
fileData3 = response3.readAll()
fs.makeDir("/cloudDir")
file1 = fs.open("/cloud", "a")
file2 = fs.open("/.cloudDir/cloud_client", "a")
file3 = fs.open("/.cloudDir/encrypt", "a")
file1.write(fileData1)
file2.write(fileData2)
file3.write(fileData3)
file1.close()
file2.close()
file3.close()
print("installed")