busybox/examples/var_service/svpage
<<
>>
Prefs
   1#!/bin/sh
   2
   3test "$1" || {
   4        echo "Syntax: ${0##*/} SERVICE"
   5        exit 1
   6}
   7
   8test x"$1" = x"${1#*/}" -a x"$1" != x"." && {
   9        # has no slashes and is not a "."
  10        cd "/var/service/$1" || exit $?
  11        set -- "."
  12}
  13
  14test -x "$1/page" && exec "$1/page"
  15
  16cd "log/logdir" || exit $?
  17
  18test "$PAGER" || PAGER=less
  19cat @* current | $PAGER
  20