Update openvpn-install.sh
Co-authored-by: randomshell <randshell@protonmail.com>
This commit is contained in:
parent
cd517ae074
commit
34d5de382e
1 changed files with 5 additions and 7 deletions
|
|
@ -1151,13 +1151,11 @@ function removeOpenVPN () {
|
||||||
# Get OpenVPN protocol from the configuration
|
# Get OpenVPN protocol from the configuration
|
||||||
PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||||
|
|
||||||
if [[ "$PORT" == '1194' ]] && [[ "$PROTOCOL" == "udp" ]]; then
|
|
||||||
firewall-cmd --zone=public --remove-service=openvpn
|
firewall-cmd --zone=public --remove-service=openvpn
|
||||||
firewall-cmd --permanent --zone=public --remove-service=openvpn
|
firewall-cmd --permanent --zone=public --remove-service=openvpn
|
||||||
else
|
|
||||||
firewall-cmd --zone=public --remove-port="$PORT/$PROTOCOL"
|
# Remove defined openvpn service
|
||||||
firewall-cmd --permanent --zone=public --remove-port="$PORT/$PROTOCOL"
|
rm /etc/firewalld/services/openvpn.xml
|
||||||
fi
|
|
||||||
|
|
||||||
firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
|
firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
|
||||||
firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
|
firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue