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

Yousong Zhou yszhou4tech at gmail.com
Wed Jun 10 11:03:33 EDT 2015


On Jun 10, 2015 6:30 PM, "Hendrik Lüth" <hendrik at 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 at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150610/064c1f63/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list