mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
make.sh: Store the PID in a variable to avoid $! being overwritten
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
7
make.sh
7
make.sh
@@ -777,6 +777,8 @@ execute() {
|
|||||||
# Append the command
|
# Append the command
|
||||||
execute+=( "${command[@]}" )
|
execute+=( "${command[@]}" )
|
||||||
|
|
||||||
|
local pid
|
||||||
|
|
||||||
# Return code
|
# Return code
|
||||||
local r=0
|
local r=0
|
||||||
|
|
||||||
@@ -800,9 +802,12 @@ execute() {
|
|||||||
"${execute[@]}" >> "${LOGFILE}" 2>&1 </dev/null
|
"${execute[@]}" >> "${LOGFILE}" 2>&1 </dev/null
|
||||||
} &
|
} &
|
||||||
|
|
||||||
|
# Store the PID
|
||||||
|
pid="$!"
|
||||||
|
|
||||||
# Wait for the process to complete
|
# Wait for the process to complete
|
||||||
while :; do
|
while :; do
|
||||||
wait "$!"
|
wait "${pid}"
|
||||||
|
|
||||||
# Store the return code
|
# Store the return code
|
||||||
r="$?"
|
r="$?"
|
||||||
|
|||||||
Reference in New Issue
Block a user