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