From patchwork Wed Jun 10 10:29:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Hendrik_L=C3=BCth?= X-Patchwork-Id: 482583 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3E225140281 for ; Wed, 10 Jun 2015 20:29:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=mail.linux-nerds.de header.i=@mail.linux-nerds.de header.b=Ff+hGMHv; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6FFB6280874; Wed, 10 Jun 2015 12:27:57 +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=-0.3 required=5.0 tests=BAYES_00,RDNS_NONE, T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 92E112807D7 for ; Wed, 10 Jun 2015 12:27:55 +0200 (CEST) X-policyd-weight: using cached result; rate: -7.6 Received: from mail.linux-nerds.de (unknown [188.40.113.74]) by arrakis.dune.hu (Postfix) with ESMTP for ; Wed, 10 Jun 2015 12:27:55 +0200 (CEST) Received: from ABW-LAPTOP-0072.localdomain (p5B2307AA.dip0.t-ipconnect.de [91.35.7.170]) by mail.linux-nerds.de (Postfix) with ESMTPA id 84B59280900 for ; Wed, 10 Jun 2015 12:29:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.linux-nerds.de; s=default; t=1433932171; bh=CNJeap7ogYNwvEPYI8pxAPY+OqFdK+v3Ck0WNoR9hbo=; h=From:To:Subject:Date:From; b=Ff+hGMHvCwuF+PFPpo5ajvWkpGQjjd7ZPZQy+GQdLkDq0FlDR/h7XB8k8y08kf4bR dk+1OjoysRkDQmsV9RDxjzS1WukEdfJvT6sDQZfwsoH8DpOrLKi77DDcRt83X4MKpS YdvOyD5lhn71riIR5XoGbp0R7TCsxvkNPHlajueQ= From: =?UTF-8?q?Hendrik=20L=C3=BCth?= To: openwrt-devel@lists.openwrt.org Date: Wed, 10 Jun 2015 12:29:24 +0200 Message-Id: <1433932164-16099-1-git-send-email-hendrik@linux-nerds.de> X-Mailer: git-send-email 2.4.1 Subject: [OpenWrt-Devel] [PATCH] base-files: add /etc/profile.d support 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" OpenWrt should support an optinal /etc/profile.d directory like most other Linux distributions. This allows packages to install their own scripts into /etc/profile.d/. --- package/base-files/files/etc/profile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 3dd58e1..c9e805f 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -14,3 +14,12 @@ export PS1='\u@\h:\w\$ ' [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; } [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } + +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/* ; do + if [ -r $i ]; then + . $i + fi + done + unset i +fi