diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/process_log.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/scripts/process_log.sh b/contrib/scripts/process_log.sh index c25c515c2..7b2363a0e 100755 --- a/contrib/scripts/process_log.sh +++ b/contrib/scripts/process_log.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/sh |
2 | 2 | ||
3 | # Usage: service should print "STARTING SERVICE (srvc) for peer [PEER]" where: | 3 | # Usage: service should print "STARTING SERVICE (srvc) for peer [PEER]" where: |
4 | # - "srvc" is the service name (in lowercase, as in the log output). | 4 | # - "srvc" is the service name (in lowercase, as in the log output). |
@@ -23,8 +23,16 @@ rm __tmp_peers | |||
23 | sed -e "$SED_EXPR" log > .log | 23 | sed -e "$SED_EXPR" log > .log |
24 | echo "$0 sed regex: $SED_EXPR" >> .log | 24 | echo "$0 sed regex: $SED_EXPR" >> .log |
25 | 25 | ||
26 | SIZE=`stat -c%s .log` | 26 | if [ -n "$(uname -a | grep -q 'Linux')" ]; then |
27 | # GNU coreutils: | ||
28 | SIZE=`stat -c%s .log` | ||
29 | else | ||
30 | # NetBSD, FreeBSD (and others?): | ||
31 | SIZE=`stat -f%z .log` | ||
32 | fi | ||
33 | |||
34 | # echo $SIZE | ||
27 | 35 | ||
28 | if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" && "$SIZE" < 10000000 ]]; then | 36 | if [ "`ps aux | grep "kwrite .lo[g]"`" = "" -a "$SIZE" -lt "10000000" ]; then |
29 | kwrite .log --geometry 960x1140-960 & | 37 | kwrite .log --geometry 960x1140-960 & |
30 | fi | 38 | fi |