From 14339191afc5d77205487e3365ca2569f86afd44 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 3 Jul 2018 23:23:09 +0200 Subject: examples/var_service/: use standard logger script, viewer and pager scripts Signed-off-by: Denys Vlasenko --- examples/var_service/svpage | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 examples/var_service/svpage (limited to 'examples/var_service/svpage') diff --git a/examples/var_service/svpage b/examples/var_service/svpage new file mode 100755 index 0000000..31c3d6d --- /dev/null +++ b/examples/var_service/svpage @@ -0,0 +1,19 @@ +#!/bin/sh + +test "$1" || { + echo "Syntax: ${0##*/} SERVICE" + exit 1 +} + +test x"$1" = x"${1#*/}" -a x"$1" != x"." && { + # has no slashes and is not a "." + cd "/var/service/$1" || exit $? + set -- "." +} + +test -x "$1/page" && exec "$1/page" + +cd "log/logdir" || exit $? + +test "$PAGER" || PAGER=less +cat @* current | $PAGER -- cgit v1.1