gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: contrib/scripts/process_log


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: contrib/scripts/process_log.sh: attempt to remove bash extensions, use of 2 different stat implementations.
Date: Mon, 04 Mar 2019 17:10:18 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 6a2c563de contrib/scripts/process_log.sh: attempt to remove bash 
extensions, use of 2 different stat implementations.
6a2c563de is described below

commit 6a2c563de12d5ac6a4e4933fc8ec175a59ba9e67
Author: ng0 <address@hidden>
AuthorDate: Mon Mar 4 16:09:26 2019 +0000

    contrib/scripts/process_log.sh: attempt to remove bash extensions, use of 2 
different stat implementations.
---
 contrib/scripts/process_log.sh | 14 +++++++++++---
 1 file 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 @@
-#!/bin/bash
+#!/bin/sh
 
 # Usage: service should print "STARTING SERVICE (srvc) for peer [PEER]" where:
 # - "srvc" is the service name (in lowercase, as in the log output).
@@ -23,8 +23,16 @@ rm __tmp_peers
 sed -e "$SED_EXPR" log > .log
 echo "$0 sed regex: $SED_EXPR" >> .log
 
-SIZE=`stat -c%s .log`
+if [ -n "$(uname -a | grep -q 'Linux')" ]; then
+    # GNU coreutils:
+    SIZE=`stat -c%s .log`
+else
+    # NetBSD, FreeBSD (and others?):
+    SIZE=`stat -f%z .log`
+fi
+
+# echo $SIZE
 
-if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" && "$SIZE" < 10000000 ]]; then
+if [ "`ps aux | grep "kwrite .lo[g]"`" = "" -a "$SIZE" -lt "10000000" ]; then
     kwrite .log --geometry 960x1140-960 &
 fi

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]