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