nix-configs/other/scripts/dispatcher.nu
Schrottkatze 1cd19687be lmao
2023-10-28 22:25:06 +02:00

20 lines
423 B
Plaintext
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
| detect columns
| first
| get name
);
systemd-cat echo $"($currentnet) \(($interface)): ($type)";
if $interface == 'wlp2s0' {
^$"/etc/networkhooks/($currentnet).nu" $interface $type
}
}