Spaces in SSID in /etc/rc.conf
Gunther Mayer
gunther.mayer at googlemail.com
Sat May 19 23:25:29 UTC 2007
Christopher Cowart wrote:
> On Mon, May 14, 2007 at 09:45:48PM +0200, Gunther Mayer wrote:
>
>> Hi there,
>>
>> I got a low key server who is wirelessly connected to the net using an
>> SSID that contains a space. In rc.conf I define the ifconfig line for
>> configuration of my wireless interface upon bootup, but the entire line
>> reads something like
>>
>> ifconfig_ath0=' inet 192.168.0.1 ssid "my network" '
>>
>> No matter how I tweak the quotes (single then double, other way round,
>> with lots of \\) I never get my interface to configure properly upon
>> bootup and I need to get to the console to fix it up. I thought I knew
>> shell syntax but this is beyond me or manpages...
>>
>> What's the right way to do this?
>>
>
> One approach would be to navigate the series of function calls defined
> in /etc/network.subr. I just took a brief look, but it's not immediately
> obvious how many times you're going to have to escape exactly what to
> get the behavior you desire.
>
> Another option would be to make the file /etc/start_if.ath0, containing
> the line `ifconfig ... ssid "my network"`. This file would be sourced
> when /etc/rc.d/netif starts the network interfaces, before the rc
> variable ifconfig_ath0 is run. You can then omit the variable
> ifconfig_ath0 from /etc/rc.conf.
>
> For more hints, look in /etc/netif, /etc/network.subr, and /etc/rc.subr.
>
Thanks for all your ideas guys, I really appreciate the help. Finally
got some time to try all of your suggestions, though backwhacking (\)
the space and/or the quotes makes no difference so I decided in the end
to stop fighting the quoting wars and to just use /etc/start_if.ath0
which works perfectly. Not quite as neat as having everything live in
/etc/rc.conf but it does the trick.
More information about the freebsd-questions
mailing list