More null checks
This commit is contained in:
@ -31,10 +31,15 @@ def "tailscale peer" [
|
||||
})
|
||||
|
||||
if $hostname == null {
|
||||
$peers
|
||||
} else {
|
||||
$peers | where host == $hostname | first | get $get_field
|
||||
return $peers
|
||||
}
|
||||
|
||||
let peers = ($peers | where host == $hostname)
|
||||
if ($peers | is-empty) {
|
||||
return null
|
||||
}
|
||||
|
||||
$peers | first | get $get_field
|
||||
}
|
||||
|
||||
# SSH to a tailscale peer
|
||||
|
||||
Reference in New Issue
Block a user