From patchwork Sat Dec 6 22:32:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Heimpold X-Patchwork-Id: 418417 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 977B01400E7 for ; Sun, 7 Dec 2014 09:33:37 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 2E56328748E; Sat, 6 Dec 2014 23:31:48 +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 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 645D52805E6 for ; Sat, 6 Dec 2014 23:31:31 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .heimpold. - helo: .mo4-p00-ob.smtp.rzone. - helo-domain: .rzone.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.160]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 6 Dec 2014 23:31:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1417905191; l=918; s=domk; d=heimpold.de; h=Date:Subject:Cc:To:From; bh=/YabF7qs+xgaF2joROpYsuoTRrg=; b=V9azK6XMKmSaY0dHsLVcf3XccRGwKPPiJqr9s5WCieMk27rzdPQoji/LtAjyrQ1h/g8 7jCLlmOrD92DZkWC73T6T7JkBq53uOpY7p7Jsm4m2OsmkGgzI2cRpSeLDLLTRu15iMlOk 7Eqrb/4bSfkk//olxnYEMLJ/MeGuZO4yTZ0= X-RZG-AUTH: :O2kGeEG7b/pS1EW8QnKjhhg/vO4pzqdNys2z+NfqLSUoNNCTudAGGnyHtjxQd77aq3bA2w== X-RZG-CLASS-ID: mo00 Received: from tonne.mhei.heimpold.itr (dslb-178-012-069-235.178.012.pools.vodafone-ip.de [178.12.69.235]) by post.strato.de (RZmta 36.2 DYNA|AUTH) with ESMTPA id i02a30qB6MXBfJC; Sat, 6 Dec 2014 23:33:11 +0100 (CET) Received: from kerker.fritz.box (kerker [192.168.8.1]) by tonne.mhei.heimpold.itr (Postfix) with ESMTP id EB594127275; Sat, 6 Dec 2014 23:33:10 +0100 (CET) From: Michael Heimpold To: wigyori@uid0.hu Date: Sat, 6 Dec 2014 23:32:53 +0100 Message-Id: <1417905173-31494-9-git-send-email-mhei@heimpold.de> X-Mailer: git-send-email 1.7.10.4 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] mxs: fix automatic status led detection 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" Without -d the ls command would dereference the found led directory, but we are only interested in the directory name itself. Signed-off-by: Michael Heimpold --- target/linux/mxs/base-files/etc/diag.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/mxs/base-files/etc/diag.sh b/target/linux/mxs/base-files/etc/diag.sh index e48fa96..683e123 100644 --- a/target/linux/mxs/base-files/etc/diag.sh +++ b/target/linux/mxs/base-files/etc/diag.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2013 OpenWrt.org +# Copyright (C) 2013-2014 OpenWrt.org . /lib/functions/leds.sh . /lib/mxs.sh @@ -13,7 +13,7 @@ get_status_led() { status_led="green" ;; *) - status_led=$(cd /sys/class/leds && ls -1 *:status 2> /dev/null | head -n 1) + status_led=$(cd /sys/class/leds && ls -1d *:status 2> /dev/null | head -n 1) ;; esac }