sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #51627
SV: ifconfig & grep
Tack Hans !
Det fungerade i scriptet "Test". Problemet är att jag kan inte använda
'eval' i följande rc.firewall
#Block Back Orifice
/sbin/iptables -t filter -A INPUT -p tcp -s 0/0 -d $getip --dport 31337
-m limit --limit 2/minute -j DROP
/sbin/iptables -t filter -A INPUT -p udp -s 0/0 -d $getip --dport 31337
-m limit --limit 2/minute -j DROP
/sbin/iptables -t filter -A OUTPUT -p tcp -s $getip -d 0/0 --dport 31337
-m limit --limit 2/minute -j DROP
/sbin/iptables -t filter -A OUTPUT -p udp -s $getip -d 0/0 --dport 31337
-m limit --limit 2/minute -j DROP
Finns det en GLOBAL VARIABLE för ip adressen?
-----Ursprungligt meddelande-----
Från: Hans Christian Studt [mailto:hcstudt@xxxxxxxxxxxxxx]
Skickat: den 20 maj 2002 14:38
Till: sslug-teknik@xxxxxxxx
Ämne: Re: [TEKNIK] ifconfig & grep
Torbjörn Lundahl wrote:
>Hello!
>
>I have a problem with the script "test", this work in command line:
>ifconfig | grep -A 1 eth0 | grep inet | cut -d : -f 2 | cut -d " " -f 1
>
>This doesn't work:
>#!/bin/bash
># -rwxr-xr-x 1 root root 99 maj 15 21:14 test*
>getip='ifconfig | grep -A 1 eth0 | grep inet | cut -d : -f 2 | cut -d "
>" -f 1'
>$getip
>
Hi,
Try
eval $getip
Hans Christian
References