1 |
On Tue, 6 Feb 2007 19:09:26 +0000 |
2 |
Roy Marples <uberlord@g.o> wrote: |
3 |
|
4 |
> The stuff that handles our networking maybe written in A.N. |
5 |
> Other-Language (Mrs.), but keeping /etc/conf.d/net readable by a shell |
6 |
> script does have advantages. |
7 |
|
8 |
You need to define what shell (or subset) you want to parse it. 'sh' |
9 |
itself varies from platform to platform. The one we have is a softlink |
10 |
to bash so doesn't make any difference for Gentoo Linux except for |
11 |
limiting what can be written. I just tried variable redirection for |
12 |
example (which can be used to implement pseudo-arrays without using |
13 |
eval) - I was surprised it works in sh here - dunno if it works in BSD |
14 |
sh (doesn't on busybox). What you have on FreeBSD may be different from |
15 |
what's on Solaris. |
16 |
|
17 |
Perhaps busybox sh might be a practical set to choose, for basic posix |
18 |
compliance. |
19 |
|
20 |
|
21 |
You could simply do something like: |
22 |
|
23 |
ifconfig_eth0="\ |
24 |
10.1.1.1 netmask 255.255.255.0;\ |
25 |
10.1.1.2 netmask 255.255.255.0" |
26 |
|
27 |
which means standard shell interpretation doesn't lose information, even |
28 |
if it's actually normally parsed by something else (chose ';' as a |
29 |
separator since ':' is used in ipv6 strings). |
30 |
|
31 |
|
32 |
It seems to me that the problem you're trying to solve, is the |
33 |
implementation of baselayout on restricted systems. Reducing all |
34 |
init.d/conf.d and so on to a common denominator for everyone isn't |
35 |
necessarily the best way forward. A different approach could be to |
36 |
provide more than one baselayout; one for large systems, where |
37 |
expecting to have bash available isn't such a big deal, and one for |
38 |
limited systems, restricted to busybox-standard sh. Actually I kinda |
39 |
assumed that's what baselayout-lite was all about... |
40 |
|
41 |
-- |
42 |
Kevin F. Quinn |