From ab8e372e83ef34fea90e4b4d01cab98871fdfbe9 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:18:26 -0600 Subject: [PATCH] fix(scripts): fix default handling fix #1663: made indicated reply defaults work correctly --- scripts/uninstall.sh | 2 +- scripts/wireguard/disableCONF.sh | 2 +- scripts/wireguard/enableCONF.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 48b06b7..b466782 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -321,7 +321,7 @@ askreboot() { printf "It is \\e[1mstrongly\\e[0m recommended to reboot " printf "after un-installation.\\n" - read -p "Would you like to reboot now? [y/n]: " -n 1 -r + read -p "Would you like to reboot now? [y/N]: " -n 1 -r echo diff --git a/scripts/wireguard/disableCONF.sh b/scripts/wireguard/disableCONF.sh index bd1220c..901256c 100755 --- a/scripts/wireguard/disableCONF.sh +++ b/scripts/wireguard/disableCONF.sh @@ -106,7 +106,7 @@ for CLIENT_NAME in "${CLIENTS_TO_CHANGE[@]}"; do read -r -p "Confirm you want to disable ${CLIENT_NAME}? [Y/n] " fi - if [[ "${REPLY}" =~ ^[Yy]$ ]]; then + if [[ "${REPLY}" =~ ^[Yy]$ ]] || [[ -z "${REPLY}" ]]; then # Disable the peer section from the server config echo "${CLIENT_NAME}" diff --git a/scripts/wireguard/enableCONF.sh b/scripts/wireguard/enableCONF.sh index 9d1e555..390b0a9 100755 --- a/scripts/wireguard/enableCONF.sh +++ b/scripts/wireguard/enableCONF.sh @@ -106,7 +106,7 @@ for CLIENT_NAME in "${CLIENTS_TO_CHANGE[@]}"; do read -r -p "Confirm you want to enable ${CLIENT_NAME}? [Y/n] " fi - if [[ "${REPLY}" =~ ^[Yy]$ ]]; then + if [[ "${REPLY}" =~ ^[Yy]$ ]] || [[ -z "${REPLY}" ]]; then # Enable the peer section from the server config echo "${CLIENT_NAME}"