Last active
January 22, 2018 14:44
-
-
Save yuuki/5b8de59e89bf29b1af289e2a5e0a68cb to your computer and use it in GitHub Desktop.
リモートコマンドラッパー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e -o pipefail | |
DEPLOY_TO='operationserver' | |
CMD="$@" | |
if [ -z "${CMD}" ]; then | |
echo "CMD required" 1>&2 | |
exit 1 | |
fi | |
# -A は agent forwarding | |
# これを指定しないと、SSH_AUTH_SOCKを使って、オペレーションサーバのその先のホストに自分のユーザでログインできない | |
ssh -t -A ${DEPLOY_TO} "${CMD}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment