-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcode.sh
More file actions
executable file
·27 lines (21 loc) · 826 Bytes
/
Copy pathcode.sh
File metadata and controls
executable file
·27 lines (21 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
if [ -n "$1" ]; then
cert_path = $1
else
#Get current cer file from inventory file
cert_path=$(cat inventory | ggrep -Po "(?<==).*\.pem")
fi
#Get Host from inventory file
host=$(cat inventory | ggrep -Po "(.*)amazonaws\.com")
echo Host: $host
echo Key file: $PWD/$cert_path
echo Write ssh config file...
echo "" >> ~/.ssh/config
echo "Host $host" >> ~/.ssh/config
echo " User ubuntu" >> ~/.ssh/config
echo " HostName $host" >> ~/.ssh/config
echo " IdentityFile $PWD/$cert_path" >> ~/.ssh/config
#echo " LocalForward 127.0.0.1:8080 172.18.255.200:443" >> ~/.ssh/config
#echo " LocalForward 127.0.0.1:1337 127.0.0.1:1337" >> ~/.ssh/config
# This script is used to open a remote VSCode session.
#code --folder-uri=vscode-remote://$host/home/go/src/github.com/mesosphere/dkp-insights/