Sponsored Content
Full Discussion: fi
Top Forums Shell Programming and Scripting fi Post 302218895 by chrisb345 on Sunday 27th of July 2008 12:33:28 PM
Old 07-27-2008
fi

Does anybody know what is wrong here. I am running centOS
Code:
the anticrash gives me this.

#!/bin/sh

while true
do
  rm banme.tmp
  :> banme.txt
  /usr/sbin/tcpdump -p -c 100 -n -i eth0 "dst host 66.197.12 6.19 and udp port 7777" >banme.tmp 
  grep "length 0" banme.tmp | cut -f 3 -d " " | cut -f 1-4 -d "." >> banme.txt
  if [ `grep -c . banme.txt` -gt 0 ]
  then
    ip=`head -1 banme.txt`
    if [ `grep -c ${ip} /etc/sysconfig/iptables` -eq 0 ]
    then
      dat=`date`
      echo "${dat} adding ${ip} to iptables" >> banme.log
      /sbin/iptables -A INPUT -s ${ip} -j DROP      
      /sbin/iptables-save > /etc/sysconfig/iptables
    else
      echo "${ip} is already in iptables" 
    fi   //LINE 20<<
  fi
  sleep 0
done

[root@inerdtech control]# sh ./anticrash.sh
: command not founde 2:
./anticrash.sh: line 20: syntax error near unexpected token `fi'
'/anticrash.sh: line 20: ` fi
 
IPTABLES-SAVE(8)						  iptables 1.6.1						  IPTABLES-SAVE(8)

NAME
iptables-save -- dump iptables rules to stdout ip6tables-save -- dump iptables rules to stdout SYNOPSIS
iptables-save [-M modprobe] [-c] [-t table] ip6tables-save [-M modprobe] [-c] [-t table] DESCRIPTION
iptables-save and ip6tables-save are used to dump the contents of IP or IPv6 Table in easily parseable format to STDOUT. Use I/O-redirect- ion provided by your shell to write to a file. -M, --modprobe modprobe_program Specify the path to the modprobe program. By default, iptables-save will inspect /proc/sys/kernel/modprobe to determine the exe- cutable's path. -c, --counters include the current values of all packet and byte counters in the output -t, --table tablename restrict output to only one table. If not specified, output includes all available tables. BUGS
None known as of iptables-1.2.1 release AUTHORS
Harald Welte <laforge@gnumonks.org> Rusty Russell <rusty@rustcorp.com.au> Andras Kis-Szabo <kisza@sch.bme.hu> contributed ip6tables-save. SEE ALSO
iptables-apply(8),iptables-restore(8), iptables(8) The iptables-HOWTO, which details more iptables usage, the NAT-HOWTO, which details NAT, and the netfilter-hacking-HOWTO which details the internals. iptables 1.6.1 IPTABLES-SAVE(8)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy