From 72c210ef1e5d8b26990787fed9b2c302cdf708fd Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Mon, 9 Mar 2020 10:43:49 +0100 Subject: [PATCH] [networking] add prompt for continuing after updating ssh key --- networking/install.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/networking/install.bash b/networking/install.bash index 025dd7a27..b0bb2d830 100644 --- a/networking/install.bash +++ b/networking/install.bash @@ -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