On 11/27/12 16:20, Christian Weisgerber wrote:
Stuart Henderson <s...@spacehopper.org> wrote:
On 2012/11/26 22:24, Christian Weisgerber wrote:
[...]
After some further reflection, I think I agree with sthen.
I am "mostly" happy with hostname.if, but I would find it useful
to have a nicer syntax that allows ignoring other parsing and
feeds the line directly to ifconfig <interface>. In sample config
files posted in various places I have often seen people abuse "up"
for this but that's no good, I don't want the interface up half-way
through config.
Yes, yes.
If there are no changes to the parser then I think it would help
to be explicit in the manual,
"The packed format is not compatible with the ifconfig(8)
command line format.
To pass a line directly to ifconfig and prevent it from being
interpreted as a packed format, use !ifconfig \$if <flags>."
Yes.
(I think I may change my files to "!ifconfig ..." format
now, it's ugly but it will avoid errors; not least because
then I can use /prefix notation rather than netmasks).
Yes. I'm switching to !ifconfig for everything but trivial addresses.
IIRC, isn't there a few distinct (non-ifconfig-compatible) cases we
handle specially, and the rest is passed as-is to ifconfig? Meaning you
already have the sought functionality? Granted, I'm no user of advanced
network configurations, and in the cases where I am, I mostly hack up
some shell script to fix it for me.
Either way, the "\$if" notation is ugly as fuck and to me only smells of
failure to do write a decent parser in shell code.
Should I ever find enough spare time, I would love to make the
hostname.if parsing saner.
/Alexander