docker: only delete IP when it exists

This commit is contained in:
bergware
2025-05-09 23:03:20 +02:00
parent 7ea1095cca
commit d5305b6cd8

View File

@@ -458,7 +458,7 @@ docker_network_start(){
[[ ! $IPS =~ $IPV4 ]] && run ip addr add $IPV4 metric $INDEX dev $VHOST
log "prepared network $VHOST for host access"
else
if [[ -e $SYSTEM/$VHOST ]]; then
if [[ -n $IPV4 && -e $SYSTEM/$VHOST ]]; then
# remove parent IPv4 address from vhost interface
run ip addr del $IPV4 metric $INDEX dev $VHOST
fi