mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-10-29 11:10:09 +00:00
added test for bridge overloading...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
67d7808f0b
commit
b079498481
24
host/make.sh
24
host/make.sh
@ -49,7 +49,7 @@ if xreadYes "# Update system?" UPDATE ; then
|
|||||||
@ apt upgrade
|
@ apt upgrade
|
||||||
fi
|
fi
|
||||||
if xreadYes "# Install additional apps?" APPS ; then
|
if xreadYes "# Install additional apps?" APPS ; then
|
||||||
@ apt install $(SOFTWARE[@])
|
@ apt install ${SOFTWARE[@]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Networking
|
# Networking
|
||||||
@ -67,14 +67,26 @@ if xreadYes "# Create bridges?" BRIDGES ; then
|
|||||||
xread "Gate ADMIN IP: " GATE_ADMIN_IP
|
xread "Gate ADMIN IP: " GATE_ADMIN_IP
|
||||||
readBridgeVars
|
readBridgeVars
|
||||||
|
|
||||||
|
# check if new bridges already exist in interfaces...
|
||||||
|
if [ -e /etc/network/interfaces ] \
|
||||||
|
&& grep -q \
|
||||||
|
"vmbr\(${WAN_BRIDGE}\|${LAN_BRIDGE}\|${ADMIN_BRIDGE}\)" \
|
||||||
|
/etc/network/interfaces ; then
|
||||||
|
conflict=
|
||||||
|
for br in WAN_BRIDGE LAN_BRIDGE ADMIN_BRIDGE ; do
|
||||||
|
if grep -q "vmbr${!br}" /etc/network/interfaces ; then
|
||||||
|
conflict="${conflict}, vmbr${!br} (${br})"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "ERROR: will not overwrite existing bridges: ${conflict:2}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
@ cp /etc/network/interfaces{,.new}
|
@ cp /etc/network/interfaces{,.new}
|
||||||
|
|
||||||
BRIDGES="${\
|
BRIDGES="$(\
|
||||||
cat bridges.tpl \
|
cat bridges.tpl \
|
||||||
| expandPCTTemplate WAN_PORT ADMIN_PORT}"
|
| expandPCTTemplate WAN_PORT ADMIN_PORT)"
|
||||||
|
|
||||||
# XXX check if new bridges already exist in intefaces...
|
|
||||||
# XXX
|
|
||||||
|
|
||||||
# XXX add $BRIDGES to /etc/network/interfaces either before the
|
# XXX add $BRIDGES to /etc/network/interfaces either before the
|
||||||
# source command or at the end...
|
# source command or at the end...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user