Created
September 13, 2022 01:26
-
-
Save KangDroid/d7360705e5d2ea547b4388bf99491e16 to your computer and use it in GitHub Desktop.
Azure Devops.... SSH sha-1 만 지원하지 말구...
This file contains hidden or 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 | |
function add_devops_entry { | |
cat << EOF >> $1 | |
Host ssh.dev.azure.com | |
HostkeyAlgorithms +ssh-rsa | |
PubkeyAcceptedAlgorithms +ssh-rsa | |
EOF | |
} | |
function clear_exit { | |
rm $TMP_CONFIG_DIRECTORY | |
echo "스크립트를 종료합니다.(2초 뒤 자동 종료)" | |
sleep 2 | |
exit 0 | |
} | |
# Variables | |
SSH_CONFIG_DIRECTORY=$HOME/.ssh/config | |
TMP_CONFIG_DIRECTORY=$TMPDIR/ssh_script.tmp | |
# Test SSH Configuration Directory exists. | |
if [ ! -f $SSH_CONFIG_DIRECTORY ]; then | |
touch $SSH_CONFIG_DIRECTORY | |
fi | |
# Prepare Preview | |
cat $SSH_CONFIG_DIRECTORY > $TMP_CONFIG_DIRECTORY | |
add_devops_entry $TMP_CONFIG_DIRECTORY | |
# Main | |
echo "$SSH_CONFIG_DIRECTORY 에 Azure Devops SSH SHA-1 지원을 추가합니다." | |
echo "변경 전 구성(비어있을 수 있음): $(cat $SSH_CONFIG_DIRECTORY)" | |
echo "변경 후 구성: $(cat $TMP_CONFIG_DIRECTORY)" | |
echo "진행 하시겠습니까? (yes/no 입력)" | |
read confirmation | |
# Check Input - if not yes - exit it. | |
if [ $confirmation != "yes" ]; then | |
clear_exit | |
fi | |
# Do the work | |
add_devops_entry $SSH_CONFIG_DIRECTORY | |
# Print out message | |
echo "[성공]변경 후 구성: $(cat $SSH_CONFIG_DIRECTORY)" | |
# Exit | |
clear_exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment