You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

start-ssh-tunnel.sh 353B

12345678910111213141516171819202122
  1. #! /bin/sh
  2. #
  3. if [ "$#" -eq 0 ] || [ "$#" -gt 1 ]; then
  4. echo takes only one argument
  5. exit 1
  6. fi
  7. if [ ! -e "${1}" ]; then
  8. echo cannot find "${1}"
  9. exit 1
  10. fi
  11. # shellcheck source=./env_files/ssh-tunnel-example.env
  12. . "${1}"
  13. ssh \
  14. -v \
  15. -N \
  16. -L \
  17. "${local_ip}:${local_port}:${local_ip_on_remote}:${local_port_on_remote}" \
  18. "${remote_host}"