On 2025/11/14 14:10, Klemens Nanni wrote:
> > daemon_flags="-c /var/unbound/etc/unbound.conf"
>
> This is the default and can/should go, making our script even shorter.
yes I think that does make sense.
> > . /etc/rc.d/rc.subr
> >
> > rc_pre() {
> > + local _config=$(while getopts :c: _opt $daemon_flags; do case $_opt {
> > (c) echo $OPTARG; } done)
> > - local _anchor=$(/usr/sbin/unbound-checkconf -o auto-trust-anchor-file)
> > + local _anchor=$(/usr/sbin/unbound-checkconf -o auto-trust-anchor-file
> > $_config)
>
> getopts with a leading : reads much nicer than spamlogd's sed(1) golf,
> but it still looks like... too much.
i much prefer the expanded version rather than this one-liner which
relies on "For historical reasons, open and close braces may be used
instead of in and esac"
maybe convert spamlogd to use this instead of the sed too?