diff --git a/README.md b/README.md new file mode 100644 index 0000000..57e7b35 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# CC apis + +## Installation +``` +wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua +``` + +## Apis +- `apis/net`: api to simplify sending and receiving routed messages + +## Servers +- `router`: route messages (you need to setup a router to use `apis/net`) +- `ping-server`: is automatically started on boot (use `apis/net`) + +## Programs +- `ping` : ping machines (use `apis/net`) \ No newline at end of file diff --git a/install.lua b/install.lua new file mode 100644 index 0000000..a8261ba --- /dev/null +++ b/install.lua @@ -0,0 +1,27 @@ +local LIST_FILES = { + 'ping.lua', + 'ping-server.lua', + 'router.lua', + 'startup/servers.lua', + 'apis/net.lua', +}; + +local REPO_PREFIX = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/master/' + +local previousDir = shell.dir() + +shell.setDir('/') + +fs.makeDir('/apis'); +fs.makeDir('/startup'); + +for _, filePath in pairs(LIST_FILES) do + fs.delete(filePath) + shell.execute('wget', REPO_PREFIX .. filePath, filePath) +end + +print() +print('=> Execute startup.lua') +shell.execute('/startup.lua') + +shell.setDir(previousDir)