|
@@ -15,19 +15,19 @@ fi
|
15
|
15
|
# Extract the target domain.
|
16
|
16
|
domain=$1
|
17
|
17
|
|
18
|
|
-# Get the proxy to use for that domain from the SSH configuration.
|
|
18
|
+# Get the bastion to use for that domain from the SSH configuration.
|
19
|
19
|
# The -G flag is only available with OpenSSH 6.8 (March 2015) and higher: https://www.openssh.com/txt/release-6.8
|
20
|
20
|
# The proxyjump option is only available with OpenSSH 7.3 (August 2016) and higher: https://www.openssh.com/txt/release-7.3
|
21
|
|
-proxy=`ssh -G $domain | grep proxyjump | cut -d' ' -f2`
|
|
21
|
+bastion=`ssh -G $domain | grep proxyjump | cut -d' ' -f2`
|
22
|
22
|
|
23
|
|
-if [ -z $proxy ]; then
|
24
|
|
- echo "Couldn't determine the proxy to use to contact $domain, are you sure a \"ProxyJump\" instruction is set in a configuration block matching this host?"
|
|
23
|
+if [ -z $bastion ]; then
|
|
24
|
+ echo "Couldn't determine the bastion to use to contact $domain, are you sure a \"ProxyJump\" instruction is set in a configuration block matching this host?"
|
25
|
25
|
exit 1
|
26
|
26
|
fi
|
27
|
27
|
|
28
|
28
|
# SSH logs the connection closing to stderr, so we need to get rid of that.
|
29
|
29
|
# Plus, dig via ssh appends a '\r' to the variable, which we want to get rid of too.
|
30
|
|
-ip=`ssh $proxy dig +short $domain 2> /dev/null | tr -d '\r'`
|
|
30
|
+ip=`ssh $bastion dig +short $domain 2> /dev/null | tr -d '\r'`
|
31
|
31
|
|
32
|
32
|
if [ -z "$ip" ]; then
|
33
|
33
|
echo "Couldn't lookup $domain..."
|
|
@@ -38,4 +38,4 @@ shift # Removes $1 (the FQDN) from $@
|
38
|
38
|
|
39
|
39
|
# Run the salt-ssh command with the right IP address and going through the bounce.
|
40
|
40
|
# The proxyjump option is only available with OpenSSH 7.3 (August 2016) and higher: https://www.openssh.com/txt/release-7.3
|
41
|
|
-salt-ssh --roster=scan $ip --ssh-option=ProxyJump=$proxy $@
|
|
41
|
+salt-ssh --roster=scan $ip --ssh-option=ProxyJump=$bastion $@
|