nu: Add macos network util scripts

This commit is contained in:
2025-05-06 16:23:27 +02:00
parent 79b41aa29f
commit db852f5144

23
tree/.local/nu/macos.nu Normal file
View File

@ -0,0 +1,23 @@
# Utility commands for macos
def "net route 4" [
] {
netstat -rnl -f inet | tail +4 | from ssv -m 1 | into int Refs Use Mtu
}
def "net route 6" [
] {
netstat -rnl -f inet6 | tail +4 | from ssv -m 1 | into int Refs Use Mtu
}
def "net fw rule" [
--anchor (-a): string
] {
sudo pfctl -sr -a $anchor | lines
}
def "net fw nat" [
--anchor (-a): string
] {
sudo pfctl -sn -a $anchor | lines
}