rc.d/sysctl: Use buffer to print out the sysctl changes.
authorzrj <rimvydas.jasinskas@gmail.com>
Mon, 1 Apr 2019 09:14:02 +0000 (12:14 +0300)
committerzrj <zrj@dragonflybsd.org>
Mon, 1 Apr 2019 09:40:52 +0000 (12:40 +0300)
Fixes output in logs (does not break lines).

etc/rc.d/sysctl

index 2da493b..dd06041 100644 (file)
@@ -20,7 +20,7 @@ extra_commands="reload lastload"
 
 sysctl_start()
 {
-       local config extra mib val old_val
+       local config extra mib val old_val output
 
        if [ ! -f "/etc/sysctl.conf" ]; then
                return
@@ -45,7 +45,8 @@ sysctl_start()
                if old_val=$(${SYSCTL_N} -q ${mib}); then
                        debug "sysctl '${mib}': '${old_val}' -> '${val}'"
                        if [ "${old_val}" != "${val}" ]; then
-                               ${SYSCTL_W} ${mib}=${val}
+                               output=$(${SYSCTL_W} ${mib}=${val})
+                               echo ${output}
                        fi
                elif [ "$1" = "last" ]; then
                        warn "sysctl '${mib}' does not exist."