nix-configs/other/scripts/dispatcher.nu

20 lines
423 B
Text
Raw Normal View History

2023-10-28 20:25:06 +00:00
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
2023-10-28 20:25:06 +00:00
| first
| get name
);
systemd-cat echo $"($currentnet) \(($interface)): ($type)";
if $interface starts-with 'wlp' {
2023-10-28 20:25:06 +00:00
^$"/etc/networkhooks/($currentnet).nu" $interface $type
}
}