executable_ssh 561 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. ssh_binary="$HOME/.guix-profile/bin/ssh"
  3. main()
  4. {
  5. if [[ $1 == vm[0-9]* ]] && [[ $1 != *.wugi.info ]]
  6. then
  7. exec "$ssh_binary" \
  8. -o UserKnownHostsFile=/dev/null \
  9. -o StrictHostKeyChecking=no \
  10. -i ~/.ssh/id_rsa_majordomo_sup \
  11. "sup@$(ihs vm ip $1 | recsel -Pip_address)" \
  12. "$@"
  13. elif [[ $1 == kube[0-9]* ]] && [[ $1 != *".intr" ]]
  14. then
  15. exec kubectl invoke --format=shell "--host=${1}"
  16. else
  17. exec "$ssh_binary" "$@"
  18. fi
  19. }
  20. main "$@"