base-files: allow to skip unwanted scripts
authorKonstantin Demin <[email protected]>
Thu, 4 Sep 2025 12:36:56 +0000 (15:36 +0300)
committerRobert Marko <[email protected]>
Thu, 20 Nov 2025 16:48:18 +0000 (17:48 +0100)
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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19953
Signed-off-by: Robert Marko <[email protected]>
package/base-files/files/etc/profile

index 9ce59c87e917176c3d09b67adf91b0c90a63f7a3..5c51cc42341241b7cd172ff1292705e991e81340 100644 (file)
@@ -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