rewrite networking modules

This commit is contained in:
Schrottkatze 2025-03-27 20:18:54 +01:00
parent 49298541e5
commit 0bbb0aa204
Signed by: schrottkatze
SSH key fingerprint: SHA256:FPOYVeBy3QP20FEM42uWF1Wa/Qhlk+L3S2+Wuau/Auo
11 changed files with 69 additions and 71 deletions

View file

@ -0,0 +1,21 @@
def main [
interface: string
type: string
] {
$env.PATH = ($env.PATH | split row (char esep) | append '/run/current-system/sw/bin');
let currentnet = (
nmcli -m tabular connection show --active
| from ssv
| first
| get name
);
systemd-cat echo $"($currentnet) \(($interface)): ($type)";
if $interface starts-with 'wlp' {
let p = $"/etc/networkhooks/($currentnet).nu";
systemd-cat echo $p;
^$p $interface $type
}
}