summaryrefslogtreecommitdiff
path: root/src/sshg-logtail
blob: 97858d51b418017d65fe0b7a45e9701ca1a78712 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# sshg-logtail -- poll from the ends of log files using `tail`
# This file is part of SSHGuard.

tailF="tail -F -n 0 $@"
tailf="tail -f -n 0 $@"

fallback() {
    eval $tailF 2>/dev/null || exec $tailf
}

case $(uname) in
    Darwin|FreeBSD|Linux|NetBSD)
        exec $tailF;;
    OpenBSD)
        exec $tailf;;
    *)
        fallback;;
esac