From patchwork Sat Apr 25 08:40:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Darbyshire-Bryant X-Patchwork-Id: 464471 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 C0AAC1402D1 for ; Sat, 25 Apr 2015 18:41:04 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9FFE628B735; Sat, 25 Apr 2015 10:39:56 +0200 (CEST) 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 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9E332281473 for ; Sat, 25 Apr 2015 10:39:50 +0200 (CEST) X-policyd-weight: using cached result; rate: -7.7 Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0083.outbound.protection.outlook.com [157.55.234.83]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 25 Apr 2015 10:39:50 +0200 (CEST) Received: from AM2PR07MB0930.eurprd07.prod.outlook.com (25.162.37.13) by AM2PR07MB0740.eurprd07.prod.outlook.com (25.160.57.16) with Microsoft SMTP Server (TLS) id 15.1.136.25; Sat, 25 Apr 2015 08:40:45 +0000 Authentication-Results: lists.openwrt.org; dkim=none (message not signed) header.d=none; Received: from [IPv6:2001:470:183f:da2b::717c:e11c] (2001:470:183f:da2b::717c:e11c) by AM2PR07MB0930.eurprd07.prod.outlook.com (25.162.37.13) with Microsoft SMTP Server (TLS) id 15.1.136.25; Sat, 25 Apr 2015 08:40:42 +0000 Message-ID: <553B52FA.2080700@darbyshire-bryant.me.uk> Date: Sat, 25 Apr 2015 09:40:26 +0100 From: Kevin Darbyshire-Bryant User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: X-Originating-IP: [2001:470:183f:da2b::717c:e11c] X-ClientProxiedBy: BY2PR05CA024.namprd05.prod.outlook.com (10.141.250.14) To AM2PR07MB0930.eurprd07.prod.outlook.com (25.162.37.13) X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0930; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0740; X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(62966003)(77156002)(5890100001)(87976001)(5000100001)(50986999)(450100001)(568964001)(65956001)(65806001)(42186005)(122386002)(59896002)(40100003)(92566002)(33656002)(2351001)(107886001)(110136001)(512874002)(229853001)(74482002)(46102003)(87266999)(86362001)(80316001)(36756003)(54356999)(19580395003)(65816999)(19580405001)(3826002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB0930; H:[IPv6:2001:470:183f:da2b::717c:e11c]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006)(3002001); SRVR:AM2PR07MB0930; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0930; X-Forefront-PRVS: 0557CBAD84 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2015 08:40:42.7525 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0930 X-OriginatorOrg: darbyshire-bryant.me.uk Subject: [OpenWrt-Devel] [PATCH] luci:miniupnpd Fix enabled/disabled behaviour on first boot/upgrade 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: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" miniupnpd service was always disabled after firmware upgrade. Original luci default logic was 'enable miniupnpd and if that succeeds, stop and then disable the service'. It should be 'enable miniupnpd and if that fails, stop & disable the service'. Signed-off-by: Kevin Darbyshire-Bryant diff --git a/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp b/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp index fe22a3e..4c45f3c 100755 --- a/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp +++ b/applications/luci-app-upnp/root/etc/uci-defaults/luci-upnp @@ -1,6 +1,6 @@ #!/bin/sh -/etc/init.d/miniupnpd enabled && { +/etc/init.d/miniupnpd enabled || { /etc/init.d/miniupnpd stop /etc/init.d/miniupnpd disable }