github.com/m3db/m3@v1.5.0/scripts/vagrant/shared/tunnel.sh (about)

     1  #!/bin/bash
     2  
     3  set -xe
     4  
     5  if [[ "$GRAFANA_PORT" == "" ]]; then
     6      GRAFANA_PORT="3333"
     7  fi
     8  
     9  if [[ "$USER" == "" ]]; then
    10      echo "USER env var not set"
    11      exit 1
    12  fi
    13  if [[ "$SSH_KEY" == "" ]]; then
    14      echo "SSH_KEY env var not set"
    15      exit 1
    16  fi
    17  if [[ "$IP_ADDRESS" == "" ]]; then
    18      echo "IP_ADDRESS env var not set"
    19      exit 1
    20  fi
    21  
    22  # Run tunnels
    23  echo "Tunnelling"
    24  echo "Grafana available at http://localhost:$GRAFANA_PORT"
    25  ssh -N -i $SSH_KEY $USER@$IP_ADDRESS \
    26      -L $GRAFANA_PORT:localhost:3000 \
    27      -L 7201:localhost:7201