On Jun 10, 2015 6:30 PM, "Hendrik Lüth" <hend...@linux-nerds.de> wrote: > > 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/.
IMO, OpenWrt is not like most of other Linux distributions. So what are those other packages that need this and the current specific use cases? yousong > --- > 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 > -- > 2.4.1 > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel