diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/a/sysvinit-scripts/scripts/rc.S | 13 | ||||
-rwxr-xr-x | source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/source/a/sysvinit-scripts/scripts/rc.S b/source/a/sysvinit-scripts/scripts/rc.S index 310fdd288..2466cd77a 100644 --- a/source/a/sysvinit-scripts/scripts/rc.S +++ b/source/a/sysvinit-scripts/scripts/rc.S @@ -405,8 +405,17 @@ mkdir -p /var/run/faillock # Update the current kernel level in the /etc/motd (Message Of The Day) file, # if the first line of that file begins with the word 'Linux'. # You are free to modify the rest of the file as you see fit. -if [ -x /bin/sed ]; then - /bin/sed -i "{1s/^Linux.*/$(/bin/uname -sr)\./}" /etc/motd +# We'll only do this if /etc/motd already exists, is writable, and the first +# line starts with "Linux" followed by a version number that needs to be +# updated. +# +if [ -w /etc/motd ]; then + if head -n 1 /etc/motd | grep -q "^Linux " ; then + # Replace the kernel version if it is not correct: + if [ ! "$(/bin/uname -r)." = "$(head -n 1 /etc/motd | cut -f 2 -d ' ')" ]; then + sed -i "{1s/^Linux.*/$(/bin/uname -sr)\./}" /etc/motd + fi + fi fi # If there are SystemV init scripts for this runlevel, run them. diff --git a/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild b/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild index c3edbef69..12955d585 100755 --- a/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild +++ b/source/a/sysvinit-scripts/sysvinit-scripts.SlackBuild @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=sysvinit-scripts VERSION=${VERSION:-15.1} ARCH=noarch -BUILD=${BUILD:-10} +BUILD=${BUILD:-11} # If the variable PRINT_PACKAGE_NAME is set, then this script will report what # the name of the created package would be, and then exit. This information |