Make WAN Optional (omit/blank to disable)

pull/14/head
hll 2020-10-10 22:00:49 +03:00
parent 5aa320b0ce
commit 547c0967d3
1 changed files with 8 additions and 4 deletions

12
run.sh
View File

@ -88,9 +88,11 @@ function _init_network() {
--subnet $LAN_SUBNET \
$LAN_NAME || exit 1
docker network create --driver macvlan \
-o parent=$WAN_PARENT \
$WAN_NAME || exit 1
if [ ! -z "$WAN_PARENT" ]; then
docker network create --driver macvlan \
-o parent=$WAN_PARENT \
$WAN_NAME || exit 1
fi
}
function _set_hairpin() {
@ -129,7 +131,9 @@ function _create_or_start_container() {
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
--sysctl net.ipv6.conf.all.forwarding=1 \
--name $CONTAINER $IMAGE_TAG >/dev/null
docker network connect $WAN_NAME $CONTAINER
if [ ! -z "$WAN_PARENT" ]; then
docker network connect $WAN_NAME $CONTAINER
fi
_gen_config
docker start $CONTAINER