diff mbox

[OpenWrt-Devel,v2] base-files: add /etc/profile.d support

Message ID 1434088452-12666-1-git-send-email-hendrik@linux-nerds.de
State Superseded
Headers show

Commit Message

Hendrik Lüth June 12, 2015, 5:54 a.m. UTC
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/. This is the second version, which includes suggestions from
the mailing-list.
---
 package/base-files/files/etc/profile | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Hendrik Lüth June 15, 2015, 5:10 a.m. UTC | #1
Am 2015-06-12 07:54, schrieb Hendrik Lüth:
> 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/. This is the second version, which includes suggestions 
> from
> the mailing-list.
> ---
>  package/base-files/files/etc/profile | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/package/base-files/files/etc/profile
> b/package/base-files/files/etc/profile
> index 3dd58e1..d7129c3 100644
> --- a/package/base-files/files/etc/profile
> +++ b/package/base-files/files/etc/profile
> @@ -14,3 +14,13 @@ export PS1='\u@\h:\w\$ '
> 
>  [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
>  [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
> +
> +[ -z "$FAILSAFE" ] && {
> +  if [ -d /etc/profile.d ]; then
> +    for i in /etc/profile.d/*.sh ; do
> +      if [ -r $i ]; then
> +        . $i
> +      fi
> +    done
> +  fi
> +}

Good Morning,

i just wanted to ask for your oppinions on the second verison of my 
patch.

regards, Hendrik
Bastian Bittorf June 15, 2015, 7:17 a.m. UTC | #2
* Hendrik <hendrik@linux-nerds.de> [15.06.2015 09:02]:
> i just wanted to ask for your oppinions on the second verison of my
> patch.

why didnt you pay attention for all the suggestions? bye, bastian
Hendrik Lüth June 15, 2015, 7:37 a.m. UTC | #3
Am 2015-06-15 09:17, schrieb Bastian Bittorf:
> * Hendrik <hendrik@linux-nerds.de> [15.06.2015 09:02]:
>> i just wanted to ask for your oppinions on the second verison of my
>> patch.
> 
> why didnt you pay attention for all the suggestions? bye, bastian

After the discussion on the list this was what I thought was the state 
of the discussion:
- don't run /etc/profile.d/* in failsafe ( i added this)
- only execute shell-scripts (added this also)

What else is there i forgot?

regards, Hendrik
diff mbox

Patch

diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 3dd58e1..d7129c3 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -14,3 +14,13 @@  export PS1='\u@\h:\w\$ '
 
 [ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
 [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
+
+[ -z "$FAILSAFE" ] && {
+  if [ -d /etc/profile.d ]; then
+    for i in /etc/profile.d/*.sh ; do
+      if [ -r $i ]; then
+        . $i
+      fi
+    done
+  fi
+}