Dynamische IP in firewall verwenden:
#!/bin/bash
HOST=nichtaufdienervengehenbitte.de
FILE1=/root/ip
FILE2=/root/ipold
PORT=22
ping -c 1 $HOST | head -1 | awk {'print $3'} | sed 's/(//' | sed 's/)//' > $FILE1
ip=`cat $FILE1`
ip2=`cat $FILE2`if [ -f /root/ipold ]
then
/sbin/iptables -D INPUT -s $ip2 -m tcp -p tcp --dport $PORT -j ACCEPT
fi/sbin/iptables -I INPUT -s $ip -m tcp -p tcp --dport $PORT -j ACCEPT
cp -a /root/ip /root/ipold
Ja, ja kann man besser machen und Ihr seid alle so geil blabla.













Also wenn schon dann einfach
sed 's/(\|)//'
aber warum nicht gleich
dig +short $HOST
und dass mit FILE1 und FILE2 hast du auch nicht gerade lang durchgehalten, naja vielleicht das nächste mal, ich bin so geil so toll blabla
Kommt, kommt, aber danke fuer dig+short kannte ich nicht