]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
initscripts: Handle command arguments as array
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Mar 2024 13:30:33 +0000 (14:30 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Mar 2024 13:30:33 +0000 (14:30 +0100)
For some reason, the function is refusing to launch a command that has
extra arguments.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/functions

index 5a26aef45f843b55b95e628dbc93111a412b425f..5a66fd1e8c28a45f6c04e728c589eb4795bed80e 100644 (file)
@@ -512,7 +512,7 @@ loadproc()
                esac
        fi
 
-       local cmd="${@}"
+       local cmd=( "${@}" )
 
        if [ -n "${nicelevel}" ]; then
                cmd="nice -n "${nicelevel}" ${cmd}"
@@ -520,12 +520,12 @@ loadproc()
 
        if [ -n "${background}" ]; then
                (
-                       ${cmd} &>/dev/null
+                       ${cmd[@]} &>/dev/null
                ) &
                pid="$!"
                evaluate_retval
        else
-               ${cmd}
+               ${cmd[@]}
                pid="$!"
                evaluate_retval # This is "Probably" not LSB compliant, but required to be compatible with older bootscripts
        fi