fix: Wait on exit (#274)

* fix: Wait on exit
This commit is contained in:
Kroese 2023-12-28 03:46:57 +01:00 committed by GitHub
parent deeaa9b6c3
commit 886012699a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -174,7 +174,7 @@ closeNetwork () {
else
{ pkill -f dnsmasq || true; } 2>/dev/null
fKill "dnsmasq"
ip link set "$VM_NET_TAP" down promisc off || true
ip link delete "$VM_NET_TAP" || true

View file

@ -34,6 +34,18 @@ STORAGE="/storage"
# Helper functions
fKill () {
local name=$1
{ pkill -f "$name" || true; } 2>/dev/null
while pgrep -f -l "$name" >/dev/null; do
sleep 0.1
done
return 0
}
addPackage () {
local pkg=$1