On Tuesday, October 12, 2010 16:09:06 Dirkjan Ochtman wrote:
> On Fri, Oct 1, 2010 at 15:07, Peter Volkov wrote:
> >> if [[ -n $(ls /etc/openvpn/*/local.conf 2>/dev/null) ]] ; then
> >
> > I'd suggested [ -e /etc/openvpn/*/local.conf ] here, but probably there
> > are better alternatives. Also ${ROOT} is missed here.
>
> I've put ${ROOT} in, are there no better alternatives? I don't think
> anyone mentioned any.
[ -e ] will break with multiple files (which is the whole point of the glob ?)
you could use find, but that doesnt really seem any better than the ls (which
btw will spill errors if no local.conf exists):
find "${ROOT}"/etc/openvpn/*/ -maxdepth 1 -name local.conf >/dev/null
-mike
signature.asc
Description: This is a digitally signed message part.
