update_firewall-script_ipt-gateway.sh: Fix error restarting firewall.

This commit is contained in:
Christoph 2019-06-20 14:04:44 +02:00
parent 33b4a60887
commit 29cc5150b7

View File

@ -206,6 +206,7 @@ DEFAULT_FIREWALL_CONFIGURATION_FILES="
logging_ipv4.conf logging_ipv4.conf
logging_ipv6.conf logging_ipv6.conf
post_decalrations.conf post_decalrations.conf
default_ports.conf
" "
if [[ -f "$conf_file" ]]; then if [[ -f "$conf_file" ]]; then
@ -330,7 +331,7 @@ blank_line
echononl "Restart IPv4 Firewall.." echononl "Restart IPv4 Firewall.."
if $restart_ipv4_firewall ; then if $restart_ipv4_firewall ; then
/usr/local/sbin/$IPV6_FIREWALL_SCRIPT > /dev/null 2> "$log_file" /usr/local/sbin/$IPV4_FIREWALL_SCRIPT > /dev/null 2> "$log_file"
if [[ $? -gt 0 ]]; then if [[ $? -gt 0 ]]; then
echo_failed echo_failed
error "$(cat "$log_file")" error "$(cat "$log_file")"
@ -342,7 +343,9 @@ else
fi fi
echononl "Restart IPv6 Firewall.." echononl "Restart IPv6 Firewall.."
if $restart_ipv6_firewall ; then if $restart_ipv6_firewall \
&& [[ -f "/etc/ipt-firewall/main_ipv6.conf" ]] \
&& [[ -f "/usr/local/sbin/$IPV6_FIREWALL_SCRIPT" ]]; then
/usr/local/sbin/$IPV6_FIREWALL_SCRIPT > /dev/null 2> "$log_file" /usr/local/sbin/$IPV6_FIREWALL_SCRIPT > /dev/null 2> "$log_file"
if [[ $? -gt 0 ]]; then if [[ $? -gt 0 ]]; then
echo_failed echo_failed
@ -354,7 +357,7 @@ else
echo_skipped echo_skipped
fi fi
info "Configuration files \033[1mmain_ipv[4|6].conf\033[m and \033[1mdefault_ports.conf\033[m are not considered." info "Configuration files \033[1mmain_ipv[4|6].conf\033[m are not considered."
clean_up 0 clean_up 0