rewrite networking modules
This commit is contained in:
parent
49298541e5
commit
0bbb0aa204
11 changed files with 69 additions and 71 deletions
21
modules/net/dispatchers/dispatcher.nu
Executable file
21
modules/net/dispatchers/dispatcher.nu
Executable file
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue