LoginSignup
0
1

More than 5 years have passed since last update.

踏み台経由でのsshショートカット作成

Posted at

ついでに引数で環境を選択できるようにしておく。
case文書くほどじゃないけど備忘録として書いとく。(引数による条件分岐)
gate_hostを ~/.ssh/.config に書いとく。

ssh_shortcut.sh
#!/bin/sh
ENV_VAR='service-stage'
case $1 in
  'test' ) ENV_VAR='env1' ;;
  '' ) ;;
  * ) echo 'invalid parameter.'; exit;;
esac

ssh -t gate_host "cd path/to/; eb use $ENV_VAR; eb ssh"
参考
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1