Liam Tumulty wrote:
> 
> Has someone modified the Dshield.org reporting script so that it runs on
> EigerStein? Out of the box I don't have all of the commands installed (it
> throws its first errors on WC and TR). Any suggestions?

You could use the busybox versions; just take the busybox configuration
for Eigerstein and then enable wc and tr for it.  For tr, however, you
can use sed instead: it would even be more efficient probably:

#!/bin/sh

#  DShield bash client. V 0.0.1
#

[...snip...]

# last_count=`cat $state | tr -d "\n"`
last_count=`echo -n $(echo $state | sed '/^$/d'))`

[...snip...]

# get current length of log file
# length=`wc -l $logfile | sed 's/[^0-9]//g' | tr -d "\n"`
length=`echo -n $(wc -l $logfile | sed '/^$/d; s/[^0-9]//g')`

[...snip...]

# get the new lines from the log file and write them to $tmp
# tail -$count $logfile | grep "$filter" > $tmp
# busybox tail may not support -999 option format....
tail -n $count $logfile | grep "$filter" > $tmp

[...snip...]

# only send an e-mail if the $tmp file is not empty
if [ -s $tmp ] ; then

# question: does busybox test (or [ ) support the -s option?

_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to