1 |
Excerpts from Mike Frysinger's message of Tue Oct 12 22:57:11 +0200 2010: |
2 |
> On Tuesday, October 12, 2010 16:26:31 Jeroen Roovers wrote: |
3 |
> > On Tue, 12 Oct 2010 22:09:06 +0200 Dirkjan Ochtman wrote: |
4 |
> > > On Fri, Oct 1, 2010 at 15:07, Peter Volkov wrote: |
5 |
> > > > [a very thorough review of the openvpn ebuild] |
6 |
> > > |
7 |
> > > Thanks for reviewing, I've fixed most of the issues. |
8 |
> > > |
9 |
> > > >> if [[ -n $(ls /etc/openvpn/*/local.conf 2>/dev/null) ]] ; |
10 |
> > > >> |
11 |
> > > >> then |
12 |
> > > > |
13 |
> > > > I'd suggested [ -e /etc/openvpn/*/local.conf ] here, but probably |
14 |
> > > > there are better alternatives. Also ${ROOT} is missed here. |
15 |
> > > |
16 |
> > > I've put ${ROOT} in, are there no better alternatives? I don't think |
17 |
> > > anyone mentioned any. |
18 |
> > |
19 |
> > for foo in ${ROOT}/etc/openvpn/*/local.conf; do |
20 |
> > [ -e ${foo} ] && bar ${foo} |
21 |
> > done |
22 |
> > |
23 |
> > If no ${ROOT}/etc/openvpn/*/local.conf is found, it returns the exact |
24 |
> > string; which doesn't exist so Nothing Happens. |
25 |
> |
26 |
> i'd say doing a loop is worse than a `ls` hack. and this has quoting |
27 |
> problems, but that's ancillary ... |
28 |
> -mike |
29 |
|
30 |
What about defining following function? |
31 |
|
32 |
any_exists() { |
33 |
local f |
34 |
|
35 |
for f; do |
36 |
[[ -e $f ]] && return 0 |
37 |
done |
38 |
|
39 |
return 1 |
40 |
} |
41 |
-- |
42 |
Amadeusz Żołnowski |
43 |
|
44 |
PGP key fpr: C700 CEDE 0C18 212E 49DA 4653 F013 4531 E1DB FAB5 |