| Server IP : 104.21.84.107 / Your IP : 104.23.197.208 Web Server : Apache/2.4.63 (Ubuntu) System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.4.5 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/bash-completion/completions/ |
Upload File : |
# bash completion for iptables -*- shell-script -*-
_comp_cmd_iptables()
{
local cur prev words cword was_split comp_args
_comp_initialize -s -- "$@" || return
local table="" chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p'
local targets='ACCEPT DROP LOG ULOG REJECT'
local IFS=$' \t\n' # for ${table:+-t "$table"}
[[ ${words[*]} =~ [[:space:]]-(t|-table=?)[[:space:]]*([^[:space:]]+) ]] &&
table=${BASH_REMATCH[2]}
case $prev in
-*[AIDRPFXLZ])
_comp_compgen_split -- "$(
"$1" ${table:+-t "$table"} -nL 2>/dev/null |
command sed -ne 's/^Chain \([^ ]\{1,\}\).*$/\1/p'
)"
;;
-*t)
_comp_compgen -- -W 'nat filter mangle'
;;
-j)
if [[ $table == "filter" || ! $table ]]; then
_comp_compgen -- -W '$targets'
_comp_compgen -a split -- "$("$1" ${table:+-t "$table"} -nL \
2>/dev/null | command sed -ne "$chain" \
-e 's/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//')"
elif [[ $table == "nat" ]]; then
_comp_compgen -- -W '$targets MIRROR SNAT DNAT MASQUERADE'
_comp_compgen -a split -- "$("$1" -t "$table" -nL 2>/dev/null |
command sed -ne "$chain" \
-e 's/OUTPUT|PREROUTING|POSTROUTING//')"
elif [[ $table == "mangle" ]]; then
_comp_compgen -- -W '$targets MARK TOS'
_comp_compgen -a split -- "$("$1" -t "$table" -nL 2>/dev/null |
command sed -ne "$chain" \
-e 's/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//')"
fi
;;
*)
if [[ $cur == -* ]]; then
_comp_compgen_help - <<<"$("$1" --help 2>&1 |
command sed -e "s/^\[\!\]//")"
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
fi
;;
esac
} &&
complete -F _comp_cmd_iptables iptables
# ex: filetype=sh