diff options
author | Nils Gillmann <ng0@n0.is> | 2018-05-19 14:43:13 +0000 |
---|---|---|
committer | Nils Gillmann <ng0@n0.is> | 2018-05-19 14:43:13 +0000 |
commit | 6ab60d4920bb3199aee8cd872b930e9e3e808ba7 (patch) | |
tree | 3d761dbf8793a1d2422fbd14667255c7e0292ea4 /contrib/scripts/process_log.sh | |
parent | c2f27dfe8218545c327ab49d225a49910347c5c6 (diff) | |
download | gnunet-6ab60d4920bb3199aee8cd872b930e9e3e808ba7.tar.gz gnunet-6ab60d4920bb3199aee8cd872b930e9e3e808ba7.zip |
Restructure contrib folder.
contrib/pogen.sh -> bin/pogen.sh
bootstrap: Use new pogen location and execute it.
contrib/openvpn-tap32: Move to contrib/3rdparty/Windows/openvpn-tap32.
contrib/gnunet-logo*: Move to contrib/branding/logo/
Delete old patches in contrib, predating git.
Move buildbot data to contrib/ci/buildbot,
move docker data to contrib/ci/docker.
Create contrib/conf and populate it with config files found in contrib and bin.
Move gns related data to contrib/gns.
delete contrib/repeat.sh
Move contrib/log.php into contrib/web/log.php.
Create folder contrib/scripts and use it for most scripts in contrib.
Remove trailing whitespace in doc/Makefile.am
Signed-off-by: Nils Gillmann <ng0@n0.is>
Diffstat (limited to 'contrib/scripts/process_log.sh')
-rwxr-xr-x | contrib/scripts/process_log.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/scripts/process_log.sh b/contrib/scripts/process_log.sh new file mode 100755 index 000000000..c25c515c2 --- /dev/null +++ b/contrib/scripts/process_log.sh | |||
@@ -0,0 +1,30 @@ | |||
1 | #!/bin/bash | ||
2 | |||
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). | ||
5 | # It cannot contain parenthesis in its name. | ||
6 | # - "PEER" is the peer ID. Should be 4 alfanumeric characters | ||
7 | |||
8 | grep "STARTING SERVICE " log > __tmp_peers | ||
9 | |||
10 | SED_EXPR="" | ||
11 | while read -r line; do | ||
12 | SRVC=`echo "$line" | sed -e 's/.*(\([^)]*\)).*/\1/'` | ||
13 | PEER=`echo "$line" | sed -e 's/.*\[\(....\)\].*/\1/'` | ||
14 | PID=`echo "$line" | sed -e "s/.*$SRVC-\([0-9]*\).*/\1/"` | ||
15 | echo "$SRVC $PID => $PEER" | ||
16 | |||
17 | SED_EXPR="${SED_EXPR}s/$SRVC-\([a-z2]*\)-$PID/$SRVC \1 $PEER/;" | ||
18 | SED_EXPR="${SED_EXPR}s/$SRVC-$PID/$SRVC XXX $PEER/;" | ||
19 | SED_EXPR="${SED_EXPR}s/$SRVC-api-[0-9]/$SRVC-api- /;" | ||
20 | done < __tmp_peers | ||
21 | rm __tmp_peers | ||
22 | |||
23 | sed -e "$SED_EXPR" log > .log | ||
24 | echo "$0 sed regex: $SED_EXPR" >> .log | ||
25 | |||
26 | SIZE=`stat -c%s .log` | ||
27 | |||
28 | if [[ "`ps aux | grep "kwrite .lo[g]"`" = "" && "$SIZE" < 10000000 ]]; then | ||
29 | kwrite .log --geometry 960x1140-960 & | ||
30 | fi | ||