From 9b54225344f2ac4ac9fa3cdf857d70e9068d4982 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Fri, 15 Jul 2022 14:04:48 +0200 Subject: [PATCH] feat: add README + install.lua --- README.md | 16 ++++++++++++++++ install.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 README.md create mode 100644 install.lua 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)