Fix version detection
- Fix Libreswan version detection in upgrade scripts
This commit is contained in:
parent
694679b59c
commit
ecd99a6bba
@ -81,11 +81,12 @@ esac
|
|||||||
|
|
||||||
ipsec_ver=$(/usr/local/sbin/ipsec --version 2>/dev/null)
|
ipsec_ver=$(/usr/local/sbin/ipsec --version 2>/dev/null)
|
||||||
ipsec_ver_short=$(printf '%s' "$ipsec_ver" | sed -e 's/Linux Libreswan/Libreswan/' -e 's/ (netkey) on .*//')
|
ipsec_ver_short=$(printf '%s' "$ipsec_ver" | sed -e 's/Linux Libreswan/Libreswan/' -e 's/ (netkey) on .*//')
|
||||||
|
swan_ver_old=$(printf '%s' "$ipsec_ver_short" | sed -e 's/Libreswan //')
|
||||||
if ! printf '%s' "$ipsec_ver" | grep -q "Libreswan"; then
|
if ! printf '%s' "$ipsec_ver" | grep -q "Libreswan"; then
|
||||||
exiterr "This script requires Libreswan already installed."
|
exiterr "This script requires Libreswan already installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if printf '%s' "$ipsec_ver" | grep -qF "$SWAN_VER"; then
|
if [ "$swan_ver_old" = "$SWAN_VER" ]; then
|
||||||
echo "You already have Libreswan version $SWAN_VER installed! "
|
echo "You already have Libreswan version $SWAN_VER installed! "
|
||||||
echo "If you continue, the same version will be re-installed."
|
echo "If you continue, the same version will be re-installed."
|
||||||
echo
|
echo
|
||||||
|
@ -72,11 +72,12 @@ esac
|
|||||||
|
|
||||||
ipsec_ver=$(/usr/local/sbin/ipsec --version 2>/dev/null)
|
ipsec_ver=$(/usr/local/sbin/ipsec --version 2>/dev/null)
|
||||||
ipsec_ver_short=$(printf '%s' "$ipsec_ver" | sed -e 's/Linux Libreswan/Libreswan/' -e 's/ (netkey) on .*//')
|
ipsec_ver_short=$(printf '%s' "$ipsec_ver" | sed -e 's/Linux Libreswan/Libreswan/' -e 's/ (netkey) on .*//')
|
||||||
|
swan_ver_old=$(printf '%s' "$ipsec_ver_short" | sed -e 's/Libreswan //')
|
||||||
if ! printf '%s' "$ipsec_ver" | grep -q "Libreswan"; then
|
if ! printf '%s' "$ipsec_ver" | grep -q "Libreswan"; then
|
||||||
exiterr "This script requires Libreswan already installed."
|
exiterr "This script requires Libreswan already installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if printf '%s' "$ipsec_ver" | grep -qF "$SWAN_VER"; then
|
if [ "$swan_ver_old" = "$SWAN_VER" ]; then
|
||||||
echo "You already have Libreswan version $SWAN_VER installed! "
|
echo "You already have Libreswan version $SWAN_VER installed! "
|
||||||
echo "If you continue, the same version will be re-installed."
|
echo "If you continue, the same version will be re-installed."
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user