mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-11-29 07:58:45 +01:00
22 lines
464 B
Plaintext
Executable file
22 lines
464 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
|
|
| 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
|
|
}
|
|
}
|