-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Vagrant
ssh-config
to ~/.ssh/config
on vagrant up
- Loading branch information
Showing
4 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
vagrant_host=$1 | ||
|
||
# Add Vagrant ssh-config to ~/.ssh/config | ||
sed "/^$/d;s/Host /$NL&/" ~/.ssh/config | sed '/^Host '"$vagrant_host"'$/,/^$/d;' > config && | ||
cat config > ~/.ssh/config && | ||
rm config && | ||
vagrant ssh-config --host ${vagrant_host} >> ~/.ssh/config |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
#!/bin/bash | ||
show_usage() { | ||
echo " | ||
Usage: bin/xdebug-tunnel.sh <action> <host> | ||
|
4587eca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed-script sort of messes up my ssh-config:
I don't quite understand the sed syntax but the command seems to work better without the first part:
sed "/^$/d;s/Host /$NL&/"
What is that supposed to do?
sed '/^Host '"$vagrant_host"'$/,/^$/d;'
seems to remove an entry for
$vagrant_host
without it (and it doesn't remove the following entries).Also it might be better to only replace the entry when it's not already existing.
4587eca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in #1053