Browse Source

Revert "Adjust first steps to gain ipv6 support for firewall."

This reverts commit 218c7b14adcead2e886654fcbc45667063f71256.
Raphael Schneeberger 5 years ago
parent
commit
b69cc80f57
2 changed files with 4 additions and 5 deletions
  1. 2 3
      bin/v-add-firewall-ban
  2. 2 2
      bin/v-add-firewall-chain

+ 2 - 3
bin/v-add-firewall-ban

@@ -18,7 +18,6 @@ chain=$(echo $2|tr '[:lower:]' '[:upper:]')
 
 # Defining absolute path for iptables and modprobe
 iptables="/sbin/iptables"
-ip6tables="/sbin/ip6tables"
 
 # Includes
 source $HESTIA/func/main.sh
@@ -33,16 +32,16 @@ check_args '2' "$#" 'IP CHAIN'
 is_format_valid 'ip' 'chain'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
+
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
 # Checking server ip
-if [ -e "$HESTIA/data/ips/$ip" ] || [ "$ip" = '127.0.0.1' ] || [ "$ip" = '::1' ]; then
+if [ -e "$HESTIA/data/ips/$ip" ] || [ "$ip" = '127.0.0.1' ]; then
     exit
 fi
 

+ 2 - 2
bin/v-add-firewall-chain

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: add firewall chain
-# options: CHAIN [PORT] [PROTOCOL]
+# options: CHAIN [PORT] [PROTOCOL] [PROTOCOL]
 #
 # The function adds new rule to system firewall
 
@@ -15,11 +15,11 @@ source /etc/profile
 # Argument definition
 chain=$(echo $1 | tr '[:lower:]' '[:upper:]')
 port=$2
+protocol=${4-TCP}
 protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
 
 # Defining absolute path to iptables
 iptables="/sbin/iptables"
-ip6tables="/sbin/ip6tables"
 
 # Get hestia port by reading nginx.conf
 hestiaport=$(grep 'listen' $HESTIA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")