Skip to content

Instantly share code, notes, and snippets.

@mattbloomfield
Created April 2, 2021 14:56
Show Gist options
  • Save mattbloomfield/7d8f61e4f40f4e9d1ec065d2a8a9bc14 to your computer and use it in GitHub Desktop.
Save mattbloomfield/7d8f61e4f40f4e9d1ec065d2a8a9bc14 to your computer and use it in GitHub Desktop.
Easy way to SSH into a psh env
#!/bin/sh
BLUE=\\x1B[34m
YELLOW=\\x1B[33m
GREEN=\\x1B[32m
RED=\\x1B[31m
RESET=\\x1b[0m
## Easy way to SSH into a psh env
## Usage: fin ssh <environment>
REMOTE_ENV=$1
if [ -z "$REMOTE_ENV" ]
then
echo "${BLUE}Please choose an environment to pull from${RESET}"
select REMOTE_ENV in "master" "staging" "production"; do
case $REMOTE_ENV in
"master")
break
;;
"staging")
break
;;
"production")
break
;;
*)
echo "Invalid option $REPLY";;
esac
done
fi
SSH_URL=$(fin platform ssh --pipe --project $HOSTING_SITE -e $REMOTE_ENV)
echo "SSH URL: ${SSH_URL}"
ssh ${SSH_URL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment