mirror of
				https://github.com/angristan/openvpn-install.git
				synced 2025-10-31 14:07:36 +01:00 
			
		
		
		
	Fix UFW error
This commit is contained in:
		| @@ -134,7 +134,7 @@ if [[ -e /etc/openvpn/server.conf ]]; then | ||||
| 			read -p "Do you really want to remove OpenVPN? [y/n]: " -e -i n REMOVE | ||||
| 			if [[ "$REMOVE" = 'y' ]]; then | ||||
| 				PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2) | ||||
| 				if ufw status | grep -qw active; then | ||||
| 				if hash ufw 2>/dev/null && ufw status | grep -qw active; then | ||||
| 					ufw delete allow $PORT/udp | ||||
| 					sed -i '/^##OPENVPN_START/,/^##OPENVPN_END/d' /etc/ufw/before.rules | ||||
| 					sed -i '/^DEFAULT_FORWARD/{N;s/DEFAULT_FORWARD_POLICY="ACCEPT"\n#before openvpn: /DEFAULT_FORWARD_POLICY=/}' /etc/default/ufw | ||||
| @@ -401,7 +401,7 @@ tls-auth tls-auth.key 0" >> /etc/openvpn/server.conf | ||||
| 			firewall-cmd --zone=trusted --add-masquerade | ||||
| 			firewall-cmd --permanent --zone=trusted --add-masquerade | ||||
| 		fi | ||||
| 	elif ufw status | grep -qw active; then | ||||
| 	elif hash ufw 2>/dev/null && ufw status | grep -qw active; then | ||||
| 		ufw allow $PORT/udp | ||||
| 		if [[ "$FORWARD_TYPE" = '1' ]]; then | ||||
| 			sed -i '1s/^/##OPENVPN_START\n*nat\n:POSTROUTING ACCEPT [0:0]\n-A POSTROUTING -s 10.8.0.0\/24 -o eth0 -j MASQUERADE\nCOMMIT\n##OPENVPN_END\n\n/' /etc/ufw/before.rules | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Angristan
					Angristan