Skip to content

if ssh address is not present, make one from user and IP#2

Open
ogost wants to merge 5 commits intonot-jan:masterfrom
ogost:master
Open

if ssh address is not present, make one from user and IP#2
ogost wants to merge 5 commits intonot-jan:masterfrom
ogost:master

Conversation

@ogost
Copy link

@ogost ogost commented Jan 31, 2022

If you have passwords stored like this:

<password>
user: ogost
IP: 123.123.13.123

then make ssh_address by concatenating @.

@ogost
Copy link
Author

ogost commented Jan 31, 2022

I hope this time I got it right.

fi
if [[ "$line" == user:* ]]; then
local ssh_user=${line#"user:"}
# ssh_user=${ssh_user##+([[:space::]])}
Copy link
Owner

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sure. Sorry

fi
done < <(echo "$contents")
if [[ -z ${ssh_address+x} ]]; then
ssh_address="${ssh_user// /}@${ssh_host// /}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ssh:, IP: and user: aren't specified this will effectively disable the empty check in line 39 by setting ssh_address to "@", right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I guess I'll have to do something else.

# Default value for flags
ssh_flags="${ssh_flags:-}"

if [[ "$TERM" == "xterm-kitty" ]]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Shouldn't this go into your .bashrc / .zshrc?

Copy link
Author

Choose a reason for hiding this comment

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants