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
|
2023-11-17 20:31:06 +00:00
|
|
|
| from ssv
|
2023-10-28 20:25:06 +00:00
|
|
|
| first
|
|
|
|
| get name
|
|
|
|
);
|
|
|
|
|
|
|
|
systemd-cat echo $"($currentnet) \(($interface)): ($type)";
|
|
|
|
|
2024-02-06 18:33:09 +00:00
|
|
|
if $interface starts-with 'wlp' {
|
2024-03-01 17:22:58 +00:00
|
|
|
let p = $"/etc/networkhooks/($currentnet).nu";
|
|
|
|
systemd-cat echo $p;
|
|
|
|
^$p $interface $type
|
2023-10-28 20:25:06 +00:00
|
|
|
}
|
|
|
|
}
|