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