mirror of
				https://github.com/angristan/openvpn-install.git
				synced 2025-10-31 05:57:36 +01:00 
			
		
		
		
	fix(selinux): fix deletion of selinux policy (#555)
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 randomshell
					randomshell