collectd: remove extra newlines from the generated config
authorMaxim Storchak <m.storchak@gmail.com>
Tue, 5 Jan 2021 20:34:01 +0000 (22:34 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Sun, 10 Jan 2021 08:22:54 +0000 (10:22 +0200)
Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
utils/collectd/files/collectd.init

index e585f7b058c25cf4bbc82336ffe1ca55beec889f..ae3dba5cc04de114757b20cd6d2f509b1be31f30 100644 (file)
@@ -236,11 +236,9 @@ process_generic() {
 
        [ -z "$config" ] || {
                printf "%s<Plugin %s>\n" "${CONFIG_STRING}" "$cfg" >> "$COLLECTD_CONF"
-               echo -e "${config}" >> "$COLLECTD_CONF"
+               echo -n -e "${config}" >> "$COLLECTD_CONF"
                printf "%s</Plugin>\n" "${CONFIG_STRING}" >> "$COLLECTD_CONF"
        }
-
-       printf "\n" >> "$COLLECTD_CONF"
 }
 
 process_plugins() {