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
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to