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 Jan 9, 2021
1 parent 730d14d commit 7f414f8
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 @@ -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
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 7f414f8

Please sign in to comment.