Skip to content

Commit

Permalink
vssh
Browse files Browse the repository at this point in the history
  • Loading branch information
antipasta committed Oct 5, 2020
1 parent 3aadc17 commit d3a0a88
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,18 @@ function vpnconnect() {
echo -n 'Enter keepass pw: ';
KeePassXC.AppImage cli show /mnt/chromeos/GoogleDrive/MyDrive/keepass/keepass2.kdbx $1 -q -t -a UserName -a Password | sed -z "s|[\n\r]||2g" > $HOME/vpn/$1.tblk/Contents/Resources/creds.txt && docker start $1 && sleep 1 && rm $HOME/vpn/$1.tblk/Contents/Resources/creds.txt && echo "connected to $1"
}

function vssh() {
if [[ $@ == *mars* ]]; then
SF_SSH_ENVIRON=mars
else
SF_SSH_ENVIRON=saturn
fi

if [[ $(docker ps -q --filter name=$SF_SSH_ENVIRON) = "" ]]; then
echo "Must connect to $SF_SSH_ENVIRON..."
vpnconnect $SF_SSH_ENVIRON
sleep 10
fi
ssh $@
}

0 comments on commit d3a0a88

Please sign in to comment.