From patchwork Sun Sep 20 20:48:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stijn Segers X-Patchwork-Id: 1367986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=volatilesystems.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=AdlaIOY0; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=volatilesystems.org header.i=@volatilesystems.org header.a=rsa-sha256 header.s=mail header.b=jwxl7x6b; dkim=fail reason="signature verification failed" (1024-bit key) header.d=volatilesystems.org header.i=@volatilesystems.org header.a=rsa-sha256 header.s=mail header.b=UQmywmfq; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BvfqJ357Tz9ryj for ; Mon, 21 Sep 2020 06:50:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=puuNMeKXwJW86N5YJ/A/GrGP+K9ks8xPnQ4YOKXNFwQ=; b=AdlaIOY03Ztx89OS1SgVzbfM2U h1otF4FfT5C0pgdqx3fqoi1hnZhRWnu4hyu9HQ8+bwhahX2wODlLc4tTErM8COJDwdIvjQZZwUSDe rhDwR0akSug/wY8RmI2L+veZVpBow2inWMeHitJ3lGXJYS6Go7nxPvb1tpB5Ape45MS5oXiVcshvk xtdzXwlkxqX0zvI9JSxZOw2MXS4PMe4WHttaU8lQAS7oFyTzDJneicElrIdqWgJQuzf4fVI+k7oK9 3nwMI6mBGPRkzkuVnz1XCfWsImZjUyZmNcnswE1TrZ+grEe3Rl/gq1Ss3Gh9FBzTTF1nxkfbQd0MY XgKc7pIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kK6GN-0000vJ-BT; Sun, 20 Sep 2020 20:48:47 +0000 Received: from volatilesystems.org ([51.91.248.52]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kK6GL-0000uz-0v for openwrt-devel@lists.openwrt.org; Sun, 20 Sep 2020 20:48:46 +0000 Received: by volatilesystems.org (Postfix, from userid 112) id BA986FE17C; Sun, 20 Sep 2020 22:48:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=volatilesystems.org; s=mail; t=1600634920; bh=2KgtBbYmJX35jP/0qfUFVPSXtdw6+nK7SWVkhGzHcd0=; h=From:To:Subject:Date:From; b=jwxl7x6bePdjHB008D6wrgPYcTWP9u4tHnCcXKD6esjGyEDpCQ9txJC0q4BPbfBq6 poe78oxhKjTBWehccSr4R920Oxnfcj390LxSEJ+5n5Iyxm++llcKbQtdznn2kns/1w T8hDXpKBZnPXfT5Vi1sfgX4SA8A5A8r6mF1GkC7M= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on atalanta X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from okeanos.lan (unknown [213.219.165.25]) by volatilesystems.org (Postfix) with ESMTPSA id 94AC0FE17A for ; Sun, 20 Sep 2020 22:48:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=volatilesystems.org; s=mail; t=1600634918; bh=2KgtBbYmJX35jP/0qfUFVPSXtdw6+nK7SWVkhGzHcd0=; h=From:To:Subject:Date:From; b=UQmywmfq1EO3DbV3hdAdZEoM0lLfjsJUgHDqCjRCKxWjsfLezbQQRTcCZAY1BaM0k V6bgVzpapI2tFFyYUGrnbbq4VzLvJx7BVV9hVoS9mHmbpvzFOlWuKOpYW+nBfuOIou 8cfKei3pXxyweXeLE//bptm6KtWZFUQ9xBoxkK60= From: Stijn Segers To: openwrt-devel@lists.openwrt.org Subject: [PATCH] odhcpd: number UCI defaults script Date: Sun, 20 Sep 2020 22:48:33 +0200 Message-Id: <20200920204833.2878-1-foss@volatilesystems.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at atalanta X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200920_164845_170516_17D785AF X-CRM114-Status: GOOD ( 13.39 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org UCI defaults scripts are supposed to be numbered, but odhcpd's lacked numbering, which turned out to mess up my custom scripts numbered 9[0-9]_*. The idea is to have high number scripts executed last. Jow confirmed numbering is the default case, not the exception (thanks). Signed-off-by: Stijn Segers --- .../services/odhcpd/files/15_odhcpd.defaults | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/network/services/odhcpd/files/15_odhcpd.defaults diff --git a/package/network/services/odhcpd/files/15_odhcpd.defaults b/package/network/services/odhcpd/files/15_odhcpd.defaults new file mode 100644 index 0000000000..5a1706f785 --- /dev/null +++ b/package/network/services/odhcpd/files/15_odhcpd.defaults @@ -0,0 +1,32 @@ +#!/bin/sh +uci -q get dhcp.odhcpd && exit 0 +touch /etc/config/dhcp + +. /usr/share/libubox/jshn.sh + +json_load "$(cat /etc/board.json)" +json_select network +json_select lan +json_get_vars protocol +json_select .. +json_select .. + +case "$protocol" in +# only enable server mode on statically addressed lan ports +"static") [ -e /proc/sys/net/ipv6 ] && MODE=server || MODE=disabled ;; +*) MODE=disabled ;; +esac + +uci batch <