nix-configs/other/scripts/dispatcher.nu

19 lines
423 B
Text
Executable file

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' {
^$"/etc/networkhooks/($currentnet).nu" $interface $type
}
}