mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-14 13:02:58 +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
|
||||
execute+=( "${command[@]}" )
|
||||
|
||||
local pid
|
||||
|
||||
# Return code
|
||||
local r=0
|
||||
|
||||
@@ -800,9 +802,12 @@ execute() {
|
||||
"${execute[@]}" >> "${LOGFILE}" 2>&1 </dev/null
|
||||
} &
|
||||
|
||||
# Store the PID
|
||||
pid="$!"
|
||||
|
||||
# Wait for the process to complete
|
||||
while :; do
|
||||
wait "$!"
|
||||
wait "${pid}"
|
||||
|
||||
# Store the return code
|
||||
r="$?"
|
||||
|
||||
Reference in New Issue
Block a user