rc.docker: Fix multiple fixed IPs

This commit is contained in:
Florian Bach
2023-06-04 12:33:01 +02:00
committed by Florian Bach
parent ba9f2b9fae
commit e1b7edc389
+2 -2
View File
@@ -196,7 +196,7 @@ start_network(){
THIS_IP=
while read_dom; do
[[ $ENTITY == Network ]] && THIS_NETWORK=$CONTENT
[[ $ENTITY == MyIP ]] && THIS_IP=${CONTENT// /} && THIS_IP=${THIS_IP//,/;}
[[ $ENTITY == MyIP ]] && THIS_IP=${CONTENT// /,} && THIS_IP=$(echo "${THIS_IP}" | tr -s "," ";")
done <$XMLFILE
# only restore valid networks
if [[ -n $THIS_NETWORK ]]; then
@@ -367,7 +367,7 @@ start_network(){
THIS_TT=${CONNECT#*,}
THIS_IP=
for IP in ${THIS_TT//;/ }; do
[[ $IP =~ '.' ]] && THIS_IP="$THIS_IP --ip $IP" || THIS_IP="$THIS_IP --ip6 $IP"
[[ $IP =~ ':' ]] && THIS_IP="$THIS_IP --ip6 $IP" || THIS_IP="$THIS_IP --ip $IP"
done
docker network connect $THIS_IP $NETWORK $THIS_ID >/dev/null
done