summaryrefslogtreecommitdiff
path: root/examples/var_service/sview
diff options
context:
space:
mode:
authorDenys Vlasenko2018-07-03 23:23:09 +0200
committerDenys Vlasenko2018-07-03 23:23:09 +0200
commit14339191afc5d77205487e3365ca2569f86afd44 (patch)
tree95fdd8f36e2dcf61126bbbdfe55c735562bcac7e /examples/var_service/sview
parentaa75a7da7f3b0bb50be82f535244137bae423fa8 (diff)
downloadbusybox-14339191afc5d77205487e3365ca2569f86afd44.zip
busybox-14339191afc5d77205487e3365ca2569f86afd44.tar.gz
examples/var_service/: use standard logger script, viewer and pager scripts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'examples/var_service/sview')
-rwxr-xr-xexamples/var_service/sview19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/var_service/sview b/examples/var_service/sview
new file mode 100755
index 0000000..716c107
--- /dev/null
+++ b/examples/var_service/sview
@@ -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/view" && exec "$1/view"
+
+cd "log/logdir" || exit $?
+
+h=`ttysize h`
+exec tail -n $((h-1)) -F current 2>&1