Merge branch 'JumpBoolOption' of mattburchett/go_tab-magic into master

This commit is contained in:
mattburchett 2019-01-14 09:23:24 -06:00 committed by Gitea
commit f37514d944
4 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,7 @@ You will need to create a config.json with your information in it:
"resolverPort": 53,
"domains": [ "kc.linuxrocker.com"],
"jumpHost": "jump01.kc.linuxrocker.com",
"useJump": false,
"splitString": ".linuxrocker",
"windowsGeometry": "1600x900"
}

View File

@ -3,6 +3,7 @@
"resolverPort": 53,
"domains": [ "kc.linuxrocker.com"],
"jumpHost": "jump01.kc.linuxrocker.com",
"useJump": false,
"splitString": ".linuxrocker",
"windowsGeometry": "1600x900"
}

View File

@ -13,6 +13,7 @@ type Config struct {
ResolverPort int `json:"resolverPort"`
Domains []string `json:"domains"`
JumpHost string `json:"jumpHost"`
UseJump bool `json:"useJump"`
SplitString string `json:"splitString"`
WindowsGeometry string `json:"windowsGeometry"`
}

View File

@ -13,6 +13,8 @@ func CreateShellAliases(data []string, username string, config config.Config) {
hostname := splitStrings[0]
txt := splitStrings[2]
useJump := config.UseJump
jump := config.JumpHost
stringSplit := config.SplitString
@ -61,6 +63,10 @@ func CreateShellAliases(data []string, username string, config config.Config) {
}
}
fmt.Printf("alias %v=\\'%v%v%v %v@%v \"%v %v %v %v %v\"'\n", host, message, prerac, hop, username, jump, rac, racOpts, remoteUser, fqdn, sudo)
if useJump {
fmt.Printf("alias %v=\\'%v%v%v %v@%v \"%v %v %v %v %v\"'\n", host, message, prerac, hop, username, jump, rac, racOpts, remoteUser, fqdn, sudo)
} else {
fmt.Printf("alias %v=\\'%v %v %v %v %v %v\n", host, message, rac, racOpts, remoteUser, fqdn, sudo)
}
}
}