mirror of
https://github.com/hwdsl2/setup-ipsec-vpn.git
synced 2024-07-01 18:15:43 +02:00
Check for install results at the end of script
This commit is contained in:
parent
4ab84f14aa
commit
be2695732d
|
@ -106,6 +106,11 @@ tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
|
|||
cd "libreswan-${SWAN_VER}" || { echo "Failed to enter Libreswan source directory. Aborting."; exit 1; }
|
||||
make programs && make install
|
||||
|
||||
# Restart services
|
||||
/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}"
|
||||
if [ "$?" != "0" ]; then
|
||||
echo
|
||||
|
@ -115,9 +120,6 @@ if [ "$?" != "0" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
service ipsec restart
|
||||
service xl2tpd restart
|
||||
|
||||
echo
|
||||
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
|
||||
|
||||
|
|
|
@ -136,6 +136,16 @@ tar xvzf "$SWAN_FILE" && rm -f "$SWAN_FILE"
|
|||
cd "libreswan-${SWAN_VER}" || { echo "Failed to enter Libreswan source directory. Aborting."; exit 1; }
|
||||
make programs && make install
|
||||
|
||||
# Restore SELinux contexts
|
||||
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
|
||||
/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}"
|
||||
if [ "$?" != "0" ]; then
|
||||
echo
|
||||
|
@ -145,14 +155,6 @@ if [ "$?" != "0" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Restore SELinux contexts
|
||||
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
|
||||
|
||||
service ipsec restart
|
||||
service xl2tpd restart
|
||||
|
||||
echo
|
||||
echo "Congratulations! Libreswan ${SWAN_VER} was installed successfully!"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user