From patchwork Thu Dec 25 01:29:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vittorio Gambaletta X-Patchwork-Id: 424016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 33EA81400DD for ; Thu, 25 Dec 2014 12:29:52 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 0D0E828BD35; Thu, 25 Dec 2014 02:27:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id AD89028A67C for ; Thu, 25 Dec 2014 02:27:45 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7.6 Received: from mail.vittgam.net (server1.vittgam.net [213.239.197.142]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 25 Dec 2014 02:27:45 +0100 (CET) X-DKIM: OpenDKIM Filter v2.4.2 mail.vittgam.net sBP1TeqD132224 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=vittgam.net; s=20110809; t=1419470980; bh=wFWQNnIC9+vmR2hV5Gka6xNNWfzN5LUD3SfGw9UFq8g=; h=Date:Content-Type:From:Message-Id:To:Subject; b=imiOyVAX0y1ZZB/dlwpZDXjhJ3HWnrCc8j+autZDLe3dKdnGISXDlL1QVAxjQ7ciR wNtP0+8db7jaGUqcW566Nqbz0l87009sTEOz2bHunHgzZGAcANF7uZIs9gR+/Tvntn UZUWuLTlzXcct3lQNU0a2uHWIZYfD80Dfto7s54E= Received: from mail2.vittgam.net ([10.48.0.5]) by mail.vittgam.net (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id sBP1TeqD132224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 25 Dec 2014 02:29:40 +0100 Received: from VittGamLaptop2 (VittGamLaptop2.router1net.VittGam.net [10.48.3.146]) by mail2.vittgam.net (8.14.4/8.14.4/Debian-2ubuntu2) with SMTP id sBP1SGpv018051; Thu, 25 Dec 2014 02:29:19 +0100 Date: Thu, 25 Dec 2014 02:29:19 +0100 From: "Vittorio G (VittGam)" Message-Id: To: Subject: [OpenWrt-Devel] [PATCH] base-files: Fix switch settings for uci-defaults-new.sh. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" The enable and reset settings need to be added even when they're false. This is true at least for 'enable', that seems to default to true otherwise. Signed-off-by: Vittorio Gambaletta diff --git a/package/base-files/files/lib/functions/uci-defaults-new.sh b/package/base-files/files/lib/functions/uci-defaults-new.sh index 0751744..7222ff8 100755 --- a/package/base-files/files/lib/functions/uci-defaults-new.sh +++ b/package/base-files/files/lib/functions/uci-defaults-new.sh @@ -70,8 +70,8 @@ ucidef_add_switch() { json_select_object switch json_select_object $name - [ "$enable" -eq 1 ] && json_add_boolean enable 1 - [ "$reset" -eq 1 ] && json_add_boolean reset 1 + json_add_boolean enable $enable + json_add_boolean reset $reset json_select .. json_select ..