From owner-freebsd-questions@FreeBSD.ORG Sat May 19 23:25:29 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B778316A421 for ; Sat, 19 May 2007 23:25:29 +0000 (UTC) (envelope-from gunther.mayer@googlemail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.190]) by mx1.freebsd.org (Postfix) with ESMTP id 474CC13C457 for ; Sat, 19 May 2007 23:25:29 +0000 (UTC) (envelope-from gunther.mayer@googlemail.com) Received: by mu-out-0910.google.com with SMTP id w8so756230mue for ; Sat, 19 May 2007 16:25:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=Etcuh3B3vTVvUDQ+gg4rKlwbBA5tfv1QqJ3nFZ0KKAehvB3D4L45+VaAR11H7w1zCBdU6b/PuxBT+Ueua1mWN8OXjd1piPjjamqwzBR2e9YEKKWpST+P9o26MbJEnHmh5g2uwjf8RhmnLKw4rG15zc7j/PoU5vgAErphDaKLNWA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=rLNluQdBS+ByQXoLZhdZDFMYZPrPOsoc+MrjqcIZEnmELQsNdsAy+fWd00GRHmlXxWQv3Ts+szgG8uaz4vokHBgPpLaxBKeG8PHN+smGaO8dUvh5CcUu2UDQ0izb2ei3P2mBSrJqdj+F2Qw21VLzaYQ0o3916VGmq+8ZglIKihE= Received: by 10.82.185.12 with SMTP id i12mr5823454buf.1179615505566; Sat, 19 May 2007 15:58:25 -0700 (PDT) Received: from ?172.25.0.8? ( [41.245.157.134]) by mx.google.com with ESMTP id e8sm12085612muf.2007.05.19.15.58.23; Sat, 19 May 2007 15:58:24 -0700 (PDT) Message-ID: <464F80EB.70705@gmail.com> Date: Sun, 20 May 2007 00:57:47 +0200 User-Agent: Thunderbird 1.5.0.10 (X11/20070403) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4648BC6C.4020609@gmail.com> <20070514212903.GS25685@rescomp.berkeley.edu> In-Reply-To: <20070514212903.GS25685@rescomp.berkeley.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Gunther Mayer Subject: Re: Spaces in SSID in /etc/rc.conf X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2007 23:25:29 -0000 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.