#!/bin/sh . /usr/lib/libmodcgi.sh sec_begin 'iptables add/remove rule' cat << EOF
Add
Insert
Chain | ||
Position (ID) | (only for Insert!) | |
Source Address | Port | |
Destination Address | Port | |
Protocol | ||
Input-Interface |
${IPTABLES_LINE} | " echo "||||||||||||
ID | " echo "Source | " echo "Destination | " echo "Protocol | " echo "Service | " echo "Service | " echo "Action | " echo "in | " echo "out | " echo "Configure | " echo "|||
---|---|---|---|---|---|---|---|---|---|---|---|---|
$(echo ${IPTABLES_LINE} | awk '{print $1}') | " echo "$(echo ${IPTABLES_LINE} | awk '{print $9}') | " echo "$(echo ${IPTABLES_LINE} | awk '{print $10}') | " echo "$(echo ${IPTABLES_LINE} | awk '{print $5}') | " if [ ! $(echo ${IPTABLES_LINE} | awk '{print $12}') ]; then echo "ANY | " else PORT=$(echo ${IPTABLES_LINE} | awk '{print $12}' | sed -e "s/.*://g") SERVICE=$(cat /tmp/flash/iptables_services | grep :$PORT$ | sed -e "s/:.*//g") [ -z "$SERVICE" ] && SERVICE="$PORT" echo "$(echo ${IPTABLES_LINE} | awk '{print $12}' | sed -e "s/:.*//g"):$SERVICE | " fi if [ ! $(echo ${IPTABLES_LINE} | awk '{print $13}') ]; then echo "ANY | " else echo ${IPTABLES_LINE} | awk '{print $13}' | grep '^to:' > /dev/null if [ $? -eq 1 ]; then PORT=$(echo ${IPTABLES_LINE} | awk '{print $13}' | sed -e "s/.*://g") SERVICE=$(cat /tmp/flash/iptables_services | grep :$PORT$ | sed -e "s/:.*//g") [ -z "$SERVICE" ] && SERVICE="$PORT" echo "$(echo ${IPTABLES_LINE} | awk '{print $13}' | sed -e "s/:.*//g"):$SERVICE | " else echo "$(echo ${IPTABLES_LINE} | awk '{print $13}') | " fi fi IMAGE=$(echo ${IPTABLES_LINE} | awk '{print $4}') echo "" echo " | $(echo ${IPTABLES_LINE} | awk '{print $7}') | " echo "$(echo ${IPTABLES_LINE} | awk '{print $8}') | " echo "remove | " echo "