mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-11-21 08:19:03 +01:00
fix(selinux): fix deletion of selinux policy (#555)
This commit is contained in:
parent
87bfd046dd
commit
3b2c84b94d
@ -1198,6 +1198,7 @@ function removeOpenVPN() {
|
||||
if [[ $REMOVE == 'y' ]]; then
|
||||
# Get OpenVPN port from the configuration
|
||||
PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||
PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||
|
||||
# Stop OpenVPN
|
||||
if [[ $OS =~ (fedora|arch|centos) ]]; then
|
||||
@ -1227,8 +1228,8 @@ function removeOpenVPN() {
|
||||
# SELinux
|
||||
if hash sestatus 2>/dev/null; then
|
||||
if sestatus | grep "Current mode" | grep -qs "enforcing"; then
|
||||
if [[ $PORT != '1194' ]]; then
|
||||
semanage port -d -t openvpn_port_t -p udp "$PORT"
|
||||
if [[ "$PORT" != '1194' ]]; then
|
||||
semanage port -d -t openvpn_port_t -p "$PROTOCOL" "$PORT"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user