Skip to content

Commit

Permalink
fix: Wait on exit (#274)
Browse files Browse the repository at this point in the history
* fix: Wait on exit
  • Loading branch information
kroese authored Dec 28, 2023
1 parent deeaa9b commit 8860126
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8860126

Please sign in to comment.