diff --git a/fish/theme-t31m/ssm_tunnel.fish b/fish/theme-t31m/ssm_tunnel.fish index 09e34c2..80990da 100644 --- a/fish/theme-t31m/ssm_tunnel.fish +++ b/fish/theme-t31m/ssm_tunnel.fish @@ -1,14 +1,14 @@ function ssm_tunnel --description 'access private AWS ressources via Bastion Host' - if test (count $argv) -lt 2 - echo "Provide an Host:Port Mapping & an Local Port" - return - end + if test (count $argv) -lt 2 + echo "Provide an Host:Port Mapping & an Local Port" + return + end - if [ $env != "ops" ] - echo "Switch to OPS ENV" - return - end + if [ "$env" != "ops" ] + echo "Switch to OPS ENV first" + return + end # Get bastion host ID using it's name set INSTANCE_ID (aws ec2 describe-instances \ @@ -40,4 +40,4 @@ function ssm_tunnel --description 'access private AWS ressources via Bastion Hos # stop socat on the bastion aws ssm cancel-command --command-id $CMD_INVOC_ID echo "Command Cancelled Successfully." -end \ No newline at end of file +end