Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Feb 2011 23:16:10 +0100
From:      J65nko <j65nko@gmail.com>
To:        kellyremo <kellyremo@zoho.com>
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: if the file changes send email about diff
Message-ID:  <AANLkTikED8gPyojVFaHUuMgRpZJ3yYzv__PszTr9ZwHJ@mail.gmail.com>
In-Reply-To: <12dfb2d663e.8735497800158401667.-7202521450009428314@zoho.com>
References:  <12dfb2d663e.8735497800158401667.-7202521450009428314@zoho.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 6, 2011 at 2:33 PM, kellyremo <kellyremo@zoho.com> wrote:
>
> I have 2 script. Script "A", Script "B".
>
> Script "A" is regulary watching the "dhcpacks" [dhcp release is configure=
d to 2mins] in the logs, for the past 2 minutes. it writes the MAC addresse=
s to a file [/dev/shm/dhcpacks-in-last-2min.txt] every 2 minutes. Ok, this =
is working, active clients are in this file. Super!
>
> Script "B": http://pastebin.com/raw.php?i=3DwvhwhPWu
> I'm trying to create a script, that watches the changes in "/dev/shm/dhcp=
acks-in-last-2min.txt" file [in every 1 sec]. Ok. But: my "watcher" script =
[the pastebined] is not working fine...sometime it works, sometime it send =
that someone "XY logged out", but it's not true! nothing happened, and the =
problem is not in the Script "A".
>
> Can someone help me point out, what am i missing? How can i watch a file =
[in every sec], that contains only MAC addresses, and if someone doesn't ge=
t dhcpack in 2 minutes, the file "/dev/shm/dhcpacks-in-last-2min.txt" chang=
es, and that clients MAC address will be gone from it, and i need to know, =
who was it [pastebined my script..but somethings wrong with it].

You are attempting to re-invent the wheel called "revision control
system" ;) Your FreeBSD box has a simple revision control system
called 'rcs'. It will do the most things you are trying to emulate in
your shell script.

Read the rcsintro(1) man page how to get started.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikED8gPyojVFaHUuMgRpZJ3yYzv__PszTr9ZwHJ>