docker_tools/sbin/docker_network_up

25 lines
492 B
Bash
Executable File

#!/bin/bash
#-------------------------------------------------------------------------------
set -o errexit
APPL_HOME_DIR="$(dirname "$(dirname "$0")")"
#-------------------------------------------------------------------------------
cd ${APPL_HOME_DIR}
. .env
if [[ "${NETWORK_TABLE}" != "" ]]
then
sbin/docker_network_down
ip rule add from ${NETWORK_ADDRESS} table ${NETWORK_TABLE}
ip route add ${NETWORK_SUBNET} dev ${NETWORK_IF_NAME} table ${NETWORK_TABLE}
fi