Enviado em 14/12/2012 - 16:09h
#criei este script:
#EX. loopback : ./murofogo.sh entrada lp aceitar
mas quando executo aparece esse erro:
./murofogo.sh: line 1: [entrada: command not found
./murofogo.sh: line 4: [entrada: command not found
./murofogo.sh: line 9: [lp: command not found
./murofogo.sh: line 17: [aceitar: command not found
./murofogo.sh: line 20: [aceitar: command not found
Bad argument `lp'
Try `iptables -h' or 'iptables --help' for more information.
ping: unknown host lp
tirei as aspas, mas continuou dando o mesmo erro.
sou iniciante ainda, desculpem os eros óbvios.
if [$1 -eq "entrada"]
then
ch="INPUT"
elif [$1 -eq "saida"]
then
ch="OUTPUT"
fi
if [$2 -eq "lp"]
then
ip=127.0.0.1
else
ip=$2
fi
if [$3 -eq "aceitar"]
then
op="ACCEPT"
elif [$3 -eq "derrubar"]
then
op="DROP"
else
op=$3
fi
# [tabela] [chain][ip] [opções]
iptables -t filter -A $ch -d $ip -j $op
ping $ip
#EX. loopback : ./murofogo.sh entrada lp aceitar
mas quando executo aparece esse erro:
./murofogo.sh: line 1: [entrada: command not found
./murofogo.sh: line 4: [entrada: command not found
./murofogo.sh: line 9: [lp: command not found
./murofogo.sh: line 17: [aceitar: command not found
./murofogo.sh: line 20: [aceitar: command not found
Bad argument `lp'
Try `iptables -h' or 'iptables --help' for more information.
ping: unknown host lp
tirei as aspas, mas continuou dando o mesmo erro.
sou iniciante ainda, desculpem os eros óbvios.