summaryrefslogtreecommitdiff
path: root/examples/var_service/sview
blob: 716c1079cdb28f5eb97b835af553b37a8ac50f31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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