-
Notifications
You must be signed in to change notification settings - Fork 1
if ssh address is not present, make one from user and IP #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
004843f
fd57354
4f6039c
007916e
03ce76d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,21 +15,36 @@ ssh_read_data() { | |
| read -r ssh_password < <(echo "$contents") | ||
|
|
||
| while read -r line; do | ||
| if [[ "$line" == ssh:* ]]; then | ||
| local ssh_address=${line#"ssh:"} | ||
| ssh_address=${ssh_address##+([[:space:]])} | ||
| fi | ||
| if [[ "$line" == sshflags:* ]]; then | ||
| local ssh_flags=${line#"sshflags:"} | ||
| ssh_flags=${ssh_flags##+([[:space:]])} | ||
| fi | ||
| if [[ "$line" == ssh:* ]]; then | ||
| local ssh_address=${line#"ssh:"} | ||
| ssh_address=${ssh_address##+([[:space:]])} | ||
| fi | ||
| if [[ "$line" == sshflags:* ]]; then | ||
| local ssh_flags=${line#"sshflags:"} | ||
| ssh_flags=${ssh_flags##+([[:space:]])} | ||
| fi | ||
| if [[ "$line" == user:* ]]; then | ||
| local ssh_user=${line#"user:"} | ||
| # ssh_user=${ssh_user##+([[:space::]])} | ||
| fi | ||
| if [[ "$line": == IP:* ]]; then | ||
| local ssh_host=${line#"IP:"} | ||
| # ssh_host=${ssh_host##+([[:space::]])} | ||
| fi | ||
| done < <(echo "$contents") | ||
| if [[ -z ${ssh_address+x} ]]; then | ||
| ssh_address="${ssh_user// /}@${ssh_host// /}" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I guess I'll have to do something else. |
||
| fi | ||
|
|
||
| [[ -z ${ssh_address+x} ]] && die "$path: SSH host not defined." | ||
| # Default value for flags | ||
| ssh_flags="${ssh_flags:-}" | ||
|
|
||
| if [[ "$TERM" == "xterm-kitty" ]]; then | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do? Shouldn't this go into your .bashrc / .zshrc?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry this wasn't supposed to be in the merge request. This is a personal setting, putting it in .bashrc / .zshrc breaks some other things in my setup. It's the first time I'm trying to do a pull request to a public repo, I guess I will make a branch and make a pull request from there. Sorry for wasting your time. Please cancel this request, I'll try to do it properly next time. |
||
| export TERM="xterm-color" | ||
| fi | ||
| export SSHPASS="$ssh_password" | ||
| /usr/bin/sshpass -e -- ssh $ssh_flags "${@:2}" "$ssh_address" | ||
| } | ||
|
|
||
| ssh_read_data "$@" | ||
| ssh_read_data "$@" | ||
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.
Can you remove the old code comments?
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.
Yeah sure. Sorry