User Tools

Site Tools


pling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
pling [2006/10/16 23:16] 206.161.205.188pling [2007/12/30 03:13] (current) – wrong word, package -> packet 24.217.137.10
Line 1: Line 1:
 +======Hear your Firewall======
 +
 +This little script watches the ''/var/log/kern.log'' for the string ''[FW] default'' which is logged by my firewall when dropping a packet. For each map a little beep is sent to the pc speaker.
 +
 +You need ''beep'' for it.
 +
 +  #> apt-get install beep
 +
 +<code bash>
 +#!/bin/sh
 +
 +tail -f /var/log/kern.log | \
 + awk '
 +   $0 ~ /\[FW\] default/ {
 +     match($0, / DPT=([0-9]+) /, matches);
 +     port = matches[1];
 +     print port;
 +     if (port < 1024) {
 +       system("beep -f 500 -l 100");
 +     }else{
 +       system("beep -f 2000 -l 100");
 +     }
 +   }
 + '
 +</code>