#!/bin/sh
### rotate-ulog  -*- Sh -*-
## Rotate the ulogd2 ulogd.pcap file.

### Ivan Shmakov, 2021

## To the extent possible under law, the author(s) have dedicated
## all copyright and related and neighboring rights to this software
## to the public domain worldwide.  This software is distributed
## without any warranty.

## You should have received a copy of the CC0 Public Domain Dedication
## along with this software.  If not, see
## <http://creativecommons.org/publicdomain/zero/1.0/>.

### Code:
set -e
set -C -u

test "$#" -ge 1 || set -- \
    /var/log/ulog/ulogd.pcap

: "${ROTATE_HIMARK:=1007k}"
: "${ROTATE_LOMARK:=991k}"
: "${ROTATE_COMMAND0:=service ulogd2 reload}"
: "${ROTATE_COMMAND:=find ${1%/*} -cmin -3 -ls}"
export ROTATE_HIMARK ROTATE_LOMARK ROTATE_COMMAND0 ROTATE_COMMAND

## .
exec hlmrotate --verbose -- "$@"

### rotate-ulog ends here
