examples/var_service/: use standard logger script, viewer and pager scripts

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-07-03 23:23:09 +02:00
parent aa75a7da7f
commit 14339191af
51 changed files with 81 additions and 383 deletions

19
examples/var_service/svpage Executable file
View File

@@ -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