fix: Verify PID is not empty
This commit is contained in:
parent
88fd998555
commit
6f6e3e6625
1 changed files with 2 additions and 2 deletions
|
|
@ -223,7 +223,7 @@ closeNetwork() {
|
||||||
else
|
else
|
||||||
|
|
||||||
local pid="/var/run/dnsmasq.pid"
|
local pid="/var/run/dnsmasq.pid"
|
||||||
[ -f "$pid" ] && pKill "$(<"$pid")"
|
[ -s "$pid" ] && pKill "$(<"$pid")"
|
||||||
|
|
||||||
ip link set "$VM_NET_TAP" down promisc off || true
|
ip link set "$VM_NET_TAP" down promisc off || true
|
||||||
ip link delete "$VM_NET_TAP" || true
|
ip link delete "$VM_NET_TAP" || true
|
||||||
|
|
@ -251,7 +251,7 @@ getInfo() {
|
||||||
|
|
||||||
if [ -z "$MAC" ]; then
|
if [ -z "$MAC" ]; then
|
||||||
local file="$STORAGE/$PROCESS.mac"
|
local file="$STORAGE/$PROCESS.mac"
|
||||||
[ -f "$file" ] && MAC=$(<"$file")
|
[ -s "$file" ] && MAC=$(<"$file")
|
||||||
if [ -z "$MAC" ]; then
|
if [ -z "$MAC" ]; then
|
||||||
# Generate MAC address based on Docker container ID in hostname
|
# Generate MAC address based on Docker container ID in hostname
|
||||||
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
|
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue