nu: Add macos network util scripts
This commit is contained in:
23
tree/.local/nu/macos.nu
Normal file
23
tree/.local/nu/macos.nu
Normal 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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user