mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-12-23 01:35:51 +01:00
19 lines
423 B
Text
Executable file
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
|
|
| detect columns
|
|
| first
|
|
| get name
|
|
);
|
|
|
|
systemd-cat echo $"($currentnet) \(($interface)): ($type)";
|
|
|
|
if $interface == 'wlp2s0' {
|
|
^$"/etc/networkhooks/($currentnet).nu" $interface $type
|
|
}
|
|
}
|