summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Demin2025-09-04 12:36:56 +0000
committerRobert Marko2025-11-20 16:48:18 +0000
commit9b7ffed9ebbc539fca1c67f8022dc1d5a5ddd55f (patch)
treee0c113e0cb0a7d5e6dd8fb5ee8de5411b13250fe
parenteb71d1000968ff45f6ed5aeda87a86548eb0685a (diff)
downloadopenwrt-9b7ffed9ebbc539fca1c67f8022dc1d5a5ddd55f.tar.gz
base-files: allow to skip unwanted scripts
this change allows one to selectively "hush" scripts from /etc/profile.d/ directory. e.g., to skip "opkg to apk cheatsheet" message ("/etc/profile.d/apk-cheatsheet.sh") create empty file "/etc/profile.d/apk-cheatsheet.hush" using, for example, command "touch /etc/profile.d/apk-cheatsheet.hush" Signed-off-by: Konstantin Demin <rockdrilla@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19953 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--package/base-files/files/etc/profile1
1 files changed, 1 insertions, 0 deletions
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 9ce59c87e9..5c51cc4234 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -32,6 +32,7 @@ esac
if [ -z "$FAILSAFE" ] ; then
for FILE in /etc/profile.d/*.sh ; do
+ [ -f "${FILE%.sh}.hush" ] && continue
[ -f "$FILE" ] && . "$FILE"
done
unset FILE