From 3dfcebc225fa98164a23831022d83b43ca9edff1 Mon Sep 17 00:00:00 2001 From: Nyr Date: Fri, 3 Sep 2021 17:37:05 +0200 Subject: [PATCH] Fix boringtun-upgrade test --- wireguard-install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 6c02540..53bcb29 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -258,7 +258,8 @@ if [[ ! -e /etc/wireguard/wg0.conf ]]; then echo "$remove: invalid selection." read -p "Should automatic updates be enabled for it? [Y/n]: " boringtun_updates done - if [[ "$boringtun_updates" =~ ^[yY]*$ ]]; then + [[ -z "$boringtun_updates" ]] && boringtun_updates="y" + if [[ "$boringtun_updates" =~ ^[yY]$ ]]; then if [[ "$os" == "centos" || "$os" == "fedora" ]]; then cron="cronie" elif [[ "$os" == "debian" || "$os" == "ubuntu" ]]; then @@ -457,7 +458,7 @@ WantedBy=multi-user.target" >> /etc/systemd/system/wg-iptables.service # Enable and start the wg-quick service systemctl enable --now wg-quick@wg0.service # Set up automatic updates for BoringTun if the user wanted to - if [[ "$boringtun_updates" =~ ^[yY]*$ ]]; then + if [[ "$boringtun_updates" =~ ^[yY]$ ]]; then # Deploy upgrade script cat << 'EOF' > /usr/local/sbin/boringtun-upgrade #!/bin/bash