Fix user field in tailscale scp
This commit is contained in:
@ -36,12 +36,8 @@ def "tailscale ssh" [
|
||||
user_hostname: string
|
||||
...ssh_flags: string
|
||||
]: nothing -> any {
|
||||
if "@" in $user_hostname {
|
||||
let parsed = ($user_hostname | parse "{user}@{hostname}" | first)
|
||||
ssh -o $"HostName (tailscale peer $parsed.hostname | get ipv6)" $user_hostname ...$ssh_flags
|
||||
} else {
|
||||
ssh -o $"HostName (tailscale peer $user_hostname | get ipv6)" $user_hostname ...$ssh_flags
|
||||
}
|
||||
let hostname = ($user_hostname | parse -r "([^@]*@)?(?<hostname>.*)" | get 0.hostname)
|
||||
ssh -o $"HostName (tailscale peer $hostname | get ipv6)" $user_hostname ...$ssh_flags
|
||||
}
|
||||
|
||||
# SCP to a tailscale peer
|
||||
@ -53,7 +49,7 @@ def "tailscale scp" [
|
||||
|
||||
let options = (
|
||||
[$from, $to] |
|
||||
parse "{hostname}:{path}" |
|
||||
parse -r "([^@]*@)?(?<hostname>.*):(?<path>.*)" |
|
||||
each { |it| $"HostName (tailscale peer $it.hostname | get ipv6)" } |
|
||||
each { |option| ["-o", $option] } |
|
||||
flatten
|
||||
|
||||
Reference in New Issue
Block a user