From nobody Tue Nov 07 14:53:13 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SPrnP3NCnz50Lf4 for ; Tue, 7 Nov 2023 14:53:29 +0000 (UTC) (envelope-from darcy@druid.net) Received: from mail.vex.net (mail.vex.net [IPv6:2605:2600:1001::44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SPrnN6TMdz4f01 for ; Tue, 7 Nov 2023 14:53:28 +0000 (UTC) (envelope-from darcy@druid.net) Authentication-Results: mx1.freebsd.org; none Received: from [192.168.215.109] (unknown [98.186.198.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: darcy) by mail.vex.net (Postfix) with ESMTPSA id E31663E2C8; Tue, 7 Nov 2023 09:53:17 -0500 (EST) Message-ID: Date: Tue, 7 Nov 2023 08:53:13 -0600 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Trying to replace a bashism in bourne sh To: Arthur Chance , freebsd-questions@freebsd.org References: <8cdcb170-1c54-464b-aa89-c89ca98c86ca@druid.net> <48b15ea2-3fd5-4994-aace-f0b8d7dc6ede@qeng-ho.org> Content-Language: en-US From: D'Arcy Cain In-Reply-To: <48b15ea2-3fd5-4994-aace-f0b8d7dc6ede@qeng-ho.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:19842, ipnet:2605:2600::/32, country:CA] X-Rspamd-Queue-Id: 4SPrnN6TMdz4f01 On 2023-11-07 02:21, Arthur Chance wrote: > On 06/11/2023 18:45, D'Arcy Cain wrote: >> I need to do this; >> >>   ifconfig_eth3="inet $((16#c0a8c0${me} + 100))/24" >> >> Problem is that I need to do this at boot time but then it runs as >> bourne sh.  Does anyone have an equivalent for sh? > > I'm not totally familiar with bash but that (16#c0a8c0) is a hexadecimal > number equivalent to an address triplet 192.168.192. I'd guess ${me} is I should have explained more. Basically I have a bunch of servers all on the same network. I have two ethernet (or more) interfaces on each. I am setting up both IPV4 and IPV6 on both the public and the private side. I have a script that gets sourced into a small rc.conf for each server. The idea was to use the same last octet on every interface. In the server rc.conf I have something like this: hostname="smaug.vex.net" me=44 # 68 . /blah/rc.conf # common code I use hex for "me" so that I can create IPV6 addresses. So far so good. Recently, someone else set up iLO on some of the servers. To access iLO she used one of the extra ports on the servers with more than two and put a separate network on it. For some reason she says that she can't use the same last octet for that address as the other interfaces. I don't know enough about iLO yet to understand why so I am just adding the 100 as she did. At least I don't have to worry about IPV6 right now. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 788 2246 (DoD#0082) (eNTP) | what's for dinner. IM: darcy@Vex.Net, VoIP: sip:darcy@druid.net