From 85ac19fc70df3bfacb51a5d777b7ef6c67a20b3e Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Mon, 16 Jan 2017 17:31:38 -0600 Subject: [PATCH] Minor fix - Use the "fixed strings" option in "grep" commands for "swan_ver", so that the "." in this variable is treated literally. --- extras/vpnupgrade.sh | 4 ++-- extras/vpnupgrade_centos.sh | 4 ++-- vpnsetup.sh | 2 +- vpnsetup_centos.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index 3387012..e3f355e 100644 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -44,7 +44,7 @@ if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "Libreswan"; then exiterr "This script requires Libreswan already installed." fi -if /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "$swan_ver"; then +if /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs -F "$swan_ver"; then echo "You already have Libreswan version $swan_ver installed! " echo "If you continue, the same version will be re-installed." echo @@ -149,7 +149,7 @@ make -s programs && make -s install # Verify the install and clean up cd /opt/src || exiterr "Cannot enter /opt/src." /bin/rm -rf "/opt/src/libreswan-$swan_ver" -if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "$swan_ver"; then +if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs -F "$swan_ver"; then exiterr "Libreswan $swan_ver failed to build." fi diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index 4590dc3..f5d79bc 100644 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -40,7 +40,7 @@ if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "Libreswan"; then exiterr "This script requires Libreswan already installed." fi -if /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "$swan_ver"; then +if /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs -F "$swan_ver"; then echo "You already have Libreswan version $swan_ver installed! " echo "If you continue, the same version will be re-installed." echo @@ -141,7 +141,7 @@ make -s programs && make -s install # Verify the install and clean up cd /opt/src || exiterr "Cannot enter /opt/src." /bin/rm -rf "/opt/src/libreswan-$swan_ver" -if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "$swan_ver"; then +if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs -F "$swan_ver"; then exiterr "Libreswan $swan_ver failed to build." fi diff --git a/vpnsetup.sh b/vpnsetup.sh index 2f3c111..8d46ad5 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -189,7 +189,7 @@ make -s programs && make -s install # Verify the install and clean up cd /opt/src || exiterr "Cannot enter /opt/src." /bin/rm -rf "/opt/src/libreswan-$swan_ver" -if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "$swan_ver"; then +if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs -F "$swan_ver"; then exiterr "Libreswan $swan_ver failed to build." fi diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 80b83aa..f00c453 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -176,7 +176,7 @@ make -s programs && make -s install # Verify the install and clean up cd /opt/src || exiterr "Cannot enter /opt/src." /bin/rm -rf "/opt/src/libreswan-$swan_ver" -if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "$swan_ver"; then +if ! /usr/local/sbin/ipsec --version 2>/dev/null | grep -qs -F "$swan_ver"; then exiterr "Libreswan $swan_ver failed to build." fi