mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-11-22 00:39: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
|
if [[ $REMOVE == 'y' ]]; then
|
||||||
# Get OpenVPN port from the configuration
|
# Get OpenVPN port from the configuration
|
||||||
PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||||
|
PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
|
||||||
|
|
||||||
# Stop OpenVPN
|
# Stop OpenVPN
|
||||||
if [[ $OS =~ (fedora|arch|centos) ]]; then
|
if [[ $OS =~ (fedora|arch|centos) ]]; then
|
||||||
@ -1227,8 +1228,8 @@ function removeOpenVPN() {
|
|||||||
# SELinux
|
# SELinux
|
||||||
if hash sestatus 2>/dev/null; then
|
if hash sestatus 2>/dev/null; then
|
||||||
if sestatus | grep "Current mode" | grep -qs "enforcing"; then
|
if sestatus | grep "Current mode" | grep -qs "enforcing"; then
|
||||||
if [[ $PORT != '1194' ]]; then
|
if [[ "$PORT" != '1194' ]]; then
|
||||||
semanage port -d -t openvpn_port_t -p udp "$PORT"
|
semanage port -d -t openvpn_port_t -p "$PROTOCOL" "$PORT"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user