Skip to content

Commit

Permalink
[networking] add prompt for continuing after updating ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Mar 9, 2020
1 parent 2b71166 commit 72c210e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions networking/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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
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

0 comments on commit 72c210e

Please sign in to comment.