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
# Personal GitHub Account | |
Host github-personal | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_ed25519_github_personal | |
AddKeysToAgent yes | |
UseKeychain yes | |
# Work GitHub account (Posture) | |
Host github-posture |
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
# get host of provided domain ie. - getHost [DOMAIN_NAME] | |
getHost() { | |
# clean out the http(s):// bit | |
local CLEAN_HOST=$(echo "$1" | sed -E 's~^https?://~~' | cut -d/ -f1) | |
# dig command to get the IP address, sometimes the output of this command includes the CNAME record so we'll use grep to filter and grab just the IP address | |
local IP_ADDRESS=$(dig +short "$CLEAN_HOST" A | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$') | |
if [ -z "$IP_ADDRESS" ]; then | |
echo "No IP address found for $CLEAN_HOST" | |
return 1 |