Adding the ability to disable Jump support

This commit is contained in:
Matt Burchett 2018-12-05 17:07:17 -06:00
parent d6b5d7c2ed
commit 5407c7ad7d
3 changed files with 9 additions and 1 deletions

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) {
}
}
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)
}
}
}