From owner-freebsd-questions@FreeBSD.ORG Sat Sep 22 07:27:49 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C5E16A417 for ; Sat, 22 Sep 2007 07:27:49 +0000 (UTC) (envelope-from ronggui.huang@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.184]) by mx1.freebsd.org (Postfix) with ESMTP id 9266B13C4AA for ; Sat, 22 Sep 2007 07:27:49 +0000 (UTC) (envelope-from ronggui.huang@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so875410rvb for ; Sat, 22 Sep 2007 00:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=119bWZiw4UUgAYEZPFAjJQwj0oBBPr+8CzUUNK6OIx8=; b=TjwwoV/xPrHUHowE6pntfn9ZLHNpVQp33HP/nAnuIHuLy6e0Gr5YYsbQEXNMWHFLLH1TljUxyK6M9GVOxVtU4hIZChvceowmqxglxyUCwkzJIr8L0V6LoQVNWleCkxZAHPDewjtXI3E+6o1u16hS1zF8oGCw53HnxnpHzJb+auM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=idTwb5DZe+M84r12uCXpxOyY93eMIUeImuqDGwtP64UZyoTrrx86tF+ihOhbUCh72/GABA3kpa2iQA5aKjU1zX7DOhbHCq2bQUkLW07DDvHhYIPO4F3N7Iyifq55j6mcrc9F1kMJORZt5YOCnO3qNEuERRTWRh7nV7KD71spC0k= Received: by 10.142.234.12 with SMTP id g12mr136251wfh.1190446068893; Sat, 22 Sep 2007 00:27:48 -0700 (PDT) Received: by 10.143.8.5 with HTTP; Sat, 22 Sep 2007 00:27:48 -0700 (PDT) Message-ID: <38b9f0350709220027t518c05acqe0120ad98593aad8@mail.gmail.com> Date: Sat, 22 Sep 2007 15:27:48 +0800 From: ronggui To: "Gunther Mayer" In-Reply-To: <464F80EB.70705@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4648BC6C.4020609@gmail.com> <20070514212903.GS25685@rescomp.berkeley.edu> <464F80EB.70705@gmail.com> Cc: freebsd-questions@freebsd.org 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, 22 Sep 2007 07:27:49 -0000 I come across the same problem. and my solution is to use hex instead of normal string. man ifconfig, you will see: ssid ssid Set the desired Service Set Identifier (aka network name). The SSID is a string up to 32 characters in length and may be speci- fied as either a normal string or in hexadecimal when preceded by `0x'. Additionally, the SSID may be cleared by setting it to `-'. If you add the following line to /etc/rc.conf, It will works. ifconfig_ath0 = "DHCP ssid 0x6d79206e6574776f726b" Hope it helps. 2007/5/20, Gunther Mayer : > 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. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- Ronggui Huang Department of Sociology, Fudan University, Shanghai, China Department of Public and Social Administration, CityU, HK