Mail archive
alpine-devel

Re: [alpine-devel] [PATCH] main/openrc: Fix sed script in modules.initd.

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Thu, 21 Apr 2016 09:04:59 +0200

On Tue, 19 Apr 2016 23:29:04 +0200
Przemyslaw Pawelczyk <przemoc_at_zoho.com> wrote:

> Old sed script did not remove blank lines, so one could easily get:
>
> modprobe: ERROR: missing parameters. See -h.
>
> during boot, e.g. from comment in /etc/modules-load.d/lm_sensors.conf
> generated by sensors-detect (from lm_sensors-detect package).
> ---
> main/openrc/modules.initd | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/main/openrc/modules.initd b/main/openrc/modules.initd
> index a9829f4..8d94f97 100644
> --- a/main/openrc/modules.initd
> +++ b/main/openrc/modules.initd
> _at_@ -19,7 +19,7 @@ start() {
> continue
> fi
>
> - sed 's/\#.*//g' < "$f" | while read module args; do
> + sed 's/\#.*//g;/^[[:space:]]*$/d' < "$f" | while read module args; do
> modprobe -q $module $args
> done
> done

i rewrote it to be slightly more readable.

Thanks!

-nc


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Thu Apr 21 2016 - 09:04:59 GMT