瀏覽代碼

/etc/profile: read in /etc/profile.d/*.sh files

For custom projects, it is more maintainable to add custom profile settings
in a separate file, than directly in /etc/profile.

This patch modifies /etc/profile to read in *.sh files from /etc/profile.d/,
a technique commonly used in Linux distributions.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Thomas De Schampheleire 14 年之前
父節點
當前提交
2c8502e821
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      fs/skeleton/etc/profile

+ 7 - 0
fs/skeleton/etc/profile

@@ -46,3 +46,10 @@ if [ "$PS1" ]; then
     alias calc='calc -Cd '
     alias bc='calc -Cd '
 fi;
+
+# Source configuration files from /etc/profile.d
+for i in /etc/profile.d/*.sh ; do
+    if [ -r "$i" ]; then
+        . $i
+    fi
+done