add "waitup", s6 readiness helper for network interfaces

run e.g. "waitup wlan0 10" to wait until wlan0 is operationally
up and running, and then send a newline to file descriptor 10
This commit is contained in:
Daniel Barlow
2023-02-24 23:03:09 +00:00
parent 3e1082ad18
commit 03aec58c2c
4 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
{ lua, lib, fetchpatch, fetchFromGitHub, libmnl }:
let pname = "netlink";
in lua.pkgs.buildLuaPackage {
inherit pname;
version = "0.1.1-1";
buildInputs = [ libmnl ];
src = fetchFromGitHub {
repo = "lua-netlink";
owner = "chris2511";
rev = "v0.1.1";
hash = "sha256:1833naskl4p7rz5kk0byfgngvw1mvf6cnz64sr3ny7i202wv7s52";
};
buildPhase = "$CC -shared -l mnl -l lua -o netlink.so src/*.c";
installPhase = ''
mkdir -p "$out/lib/lua/${lua.luaversion}"
cp netlink.so "$out/lib/lua/${lua.luaversion}/"
'';
}