Minor improvements to upgrade scripts
This commit is contained in:
parent
e6d62a76d5
commit
139f3f3cb0
@ -54,15 +54,16 @@ fi
|
|||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "Welcome! This upgrade script will build and install Libreswan ${SWAN_VER} on your server."
|
echo "Welcome! This 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 "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 "Your existing VPN configuration files will NOT be modified."
|
||||||
|
|
||||||
if [ "$(sed 's/\..*//' /etc/debian_version 2>/dev/null)" = "7" ]; then
|
if [ "$(sed 's/\..*//' /etc/debian_version 2>/dev/null)" = "7" ]; then
|
||||||
echo
|
echo
|
||||||
echo "IMPORTANT NOTE for Debian 7 (Wheezy) users:"
|
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 "A workaround is required for your system. See: https://gist.github.com/hwdsl2/5a769b2c4436cdf02a90"
|
||||||
echo "Continue only if you have already completed the workaround."
|
echo "Continue only if you have completed the workaround."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
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 \
|
libcurl4-nss-dev libgmp3-dev flex bison gcc make \
|
||||||
libunbound-dev libnss3-tools libevent-dev
|
libunbound-dev libnss3-tools libevent-dev
|
||||||
apt-get -y --no-install-recommends install xmlto
|
apt-get -y --no-install-recommends install xmlto
|
||||||
apt-get -y install xl2tpd
|
|
||||||
|
|
||||||
# Compile and install Libreswan
|
# Compile and install Libreswan
|
||||||
SWAN_FILE="libreswan-${SWAN_VER}.tar.gz"
|
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; }
|
cd "libreswan-${SWAN_VER}" || { echo "Failed to enter Libreswan source dir. Aborting."; exit 1; }
|
||||||
make programs && make install
|
make programs && make install
|
||||||
|
|
||||||
# Restart services
|
# Restart IPsec service
|
||||||
/usr/sbin/service ipsec restart
|
/usr/sbin/service ipsec restart
|
||||||
/usr/sbin/service xl2tpd restart
|
|
||||||
|
|
||||||
# Check if Libreswan install was successful
|
# Check if Libreswan install was successful
|
||||||
/usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "${SWAN_VER}"
|
/usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "${SWAN_VER}"
|
||||||
@ -123,5 +122,4 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
|
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -64,8 +64,9 @@ fi
|
|||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "Welcome! This upgrade script will build and install Libreswan ${SWAN_VER} on your server."
|
echo "Welcome! This 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 "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 "Your existing VPN configuration files will NOT be modified."
|
||||||
|
|
||||||
echo
|
echo
|
||||||
@ -107,7 +108,6 @@ yum -y install nss-devel nspr-devel pkgconfig pam-devel \
|
|||||||
libcap-ng-devel libselinux-devel \
|
libcap-ng-devel libselinux-devel \
|
||||||
curl-devel gmp-devel flex bison gcc make \
|
curl-devel gmp-devel flex bison gcc make \
|
||||||
fipscheck-devel unbound-devel gmp gmp-devel xmlto
|
fipscheck-devel unbound-devel gmp gmp-devel xmlto
|
||||||
yum -y install ppp xl2tpd
|
|
||||||
|
|
||||||
# Installed Libevent2. Use backported version for CentOS 6.
|
# Installed Libevent2. Use backported version for CentOS 6.
|
||||||
if grep -qs "release 6" /etc/redhat-release; then
|
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/sbin -Rv 2>/dev/null
|
||||||
restorecon /usr/local/libexec/ipsec -Rv 2>/dev/null
|
restorecon /usr/local/libexec/ipsec -Rv 2>/dev/null
|
||||||
|
|
||||||
# Restart services
|
# Restart IPsec service
|
||||||
/sbin/service ipsec restart
|
/sbin/service ipsec restart
|
||||||
/sbin/service xl2tpd restart
|
|
||||||
|
|
||||||
# Check if Libreswan install was successful
|
# Check if Libreswan install was successful
|
||||||
/usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "${SWAN_VER}"
|
/usr/local/sbin/ipsec --version 2>/dev/null | grep -qs "${SWAN_VER}"
|
||||||
@ -153,5 +152,4 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
|
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user