Skip to content
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

[networking] add prompt for continuing after updating ssh key #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions networking/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ then
yes | ssh-keygen -t rsa -b 4096 -N "" -f "$ssh_key"
rm -r ${ssh_controlmasters_dir:?}/* 2>/dev/null # close all connections, to prevent any possible weird behaviour
ssh-add # Start using the new key

# prompt for continuing
while true
ar13pit marked this conversation as resolved.
Show resolved Hide resolved
do
exec < /dev/tty
read -p $'\033[1m[networking]\033[0m: Your ssh key has been updated. If you use SSH for git, update your public key '\
'on the hosts before continuing. Continue? ' -n 1 -r
exec <&-
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
break
fi
echo -e "\033[1mPlease answer with 'y' to continue\033[0m"
done
fi

# Enable persistent connection multiplexing
Expand Down