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

Bastian Bittorf bittorf at bluebottle.com
Wed Jun 10 07:16:57 EDT 2015


* Hendrik Lüth <hendrik at linux-nerds.de> [10.06.2015 12:58]:
> +  for i in /etc/profile.d/* ; do
> +    if [ -r $i ]; then
> +      . $i
> +    fi
> +  done
> +  unset i
> +fi

i like the idea, but please use at least:

command . $i
or 
( . $i )

otherwise a syntax error / file error will prevent a login.
also use the unofficial simplified OpenWrt style here, it is OK to:

for FILE in /etc/profile.d/*; do
  [ -e "$FILE" ] && ( . $FILE )
done

i'am also unsure if 'unset FILE' is maybe overkill...

bye, bastian
_______________________________________________
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