1
0
mirror of synced 2024-11-22 13:06:02 +03:00

Minor improvements to upgrade scripts

This commit is contained in:
hwdsl2 2016-01-19 23:17:18 -06:00
parent e6d62a76d5
commit 139f3f3cb0
2 changed files with 10 additions and 14 deletions

View File

@ -54,15 +54,16 @@ fi
clear
echo "Welcome! This upgrade script will build and install Libreswan ${SWAN_VER} on your server."
echo "This is intended for use on VPN servers with an older version of Libreswan installed."
echo "Welcome! This script will build and install Libreswan ${SWAN_VER} on your server."
echo "Related packages, such as those required by Libreswan compilation will also be installed."
echo "This is intended for use on VPN servers running an older version of Libreswan."
echo "Your existing VPN configuration files will NOT be modified."
if [ "$(sed 's/\..*//' /etc/debian_version 2>/dev/null)" = "7" ]; then
echo
echo "IMPORTANT NOTE for Debian 7 (Wheezy) users:"
echo "A workaround is required for your system. See: https://github.com/hwdsl2/setup-ipsec-vpn#installation"
echo "Continue only if you have already completed the workaround."
echo "A workaround is required for your system. See: https://gist.github.com/hwdsl2/5a769b2c4436cdf02a90"
echo "Continue only if you have completed the workaround."
fi
echo
@ -95,7 +96,6 @@ apt-get -y install libnss3-dev libnspr4-dev pkg-config libpam0g-dev \
libcurl4-nss-dev libgmp3-dev flex bison gcc make \
libunbound-dev libnss3-tools libevent-dev
apt-get -y --no-install-recommends install xmlto
apt-get -y install xl2tpd
# Compile and install Libreswan
SWAN_FILE="libreswan-${SWAN_VER}.tar.gz"
@ -107,9 +107,8 @@ tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
cd "libreswan-${SWAN_VER}" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; }
make programs && make install
# Restart services
# Restart IPsec service
/usr/sbin/service ipsec restart
/usr/sbin/service xl2tpd restart
# Check if Libreswan install was successful
/usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "${SWAN_VER}"
@ -123,5 +122,4 @@ fi
echo
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
exit 0

View File

@ -64,8 +64,9 @@ fi
clear
echo "Welcome! This upgrade script will build and install Libreswan ${SWAN_VER} on your server."
echo "This is intended for use on VPN servers with an older version of Libreswan installed."
echo "Welcome! This script will build and install Libreswan ${SWAN_VER} on your server."
echo "Related packages, such as those required by Libreswan compilation will also be installed."
echo "This is intended for use on VPN servers running an older version of Libreswan."
echo "Your existing VPN configuration files will NOT be modified."
echo
@ -107,7 +108,6 @@ yum -y install nss-devel nspr-devel pkgconfig pam-devel \
libcap-ng-devel libselinux-devel \
curl-devel gmp-devel flex bison gcc make \
fipscheck-devel unbound-devel gmp gmp-devel xmlto
yum -y install ppp xl2tpd
# Installed Libevent2. Use backported version for CentOS 6.
if grep -qs "release 6" /etc/redhat-release; then
@ -137,9 +137,8 @@ restorecon /etc/ipsec.d/*db 2>/dev/null
restorecon /usr/local/sbin -Rv 2>/dev/null
restorecon /usr/local/libexec/ipsec -Rv 2>/dev/null
# Restart services
# Restart IPsec service
/sbin/service ipsec restart
/sbin/service xl2tpd restart
# Check if Libreswan install was successful
/usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "${SWAN_VER}"
@ -153,5 +152,4 @@ fi
echo
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
exit 0