Skip to content

Commit

Permalink
Resolve the actual Hostname if in the config Hostname is %h
Browse files Browse the repository at this point in the history
  • Loading branch information
hangxuan authored and lonnywong committed Jan 16, 2024
1 parent f0e7ecc commit 4f5b419
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tssh/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ func getLoginParam(args *sshArgs) (*loginParam, error) {
args.Destination = destHost

// login host
hostName := getConfig(destHost, "HostName")
if hostName != "" {
param.host = hostName
} else {
param.host = destHost
param.host = destHost
if hostName := getConfig(destHost, "HostName"); hostName != "" {
var err error
param.host, err = expandTokens(hostName, args, param, "%h")
if err != nil {
return nil, err
}
}

// login user
Expand Down

0 comments on commit 4f5b419

Please sign in to comment.