mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Ignore case
This commit is contained in:
parent
5f33457965
commit
a732cebe90
@ -25,7 +25,7 @@ configureDHCP() {
|
|||||||
NETWORK=$(ip -o route | grep "${VM_NET_DEV}" | grep -v default | awk '{print $1}')
|
NETWORK=$(ip -o route | grep "${VM_NET_DEV}" | grep -v default | awk '{print $1}')
|
||||||
IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
||||||
|
|
||||||
[[ "${DEBUG}" == [Yy]* ] && set -x
|
[[ "${DEBUG}" == [Yy1]* ] && set -x
|
||||||
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge 2> /dev/null ; rc=$?; } || :
|
{ ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge 2> /dev/null ; rc=$?; } || :
|
||||||
|
|
||||||
if (( rc != 0 )); then
|
if (( rc != 0 )); then
|
||||||
@ -99,7 +99,7 @@ configureDHCP() {
|
|||||||
configureNAT () {
|
configureNAT () {
|
||||||
|
|
||||||
VM_NET_IP='20.20.20.21'
|
VM_NET_IP='20.20.20.21'
|
||||||
[[ "${DEBUG}" == [Yy]* ]] && set -x
|
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
||||||
|
|
||||||
#Create bridge with static IP for the VM guest
|
#Create bridge with static IP for the VM guest
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ configureNAT () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
{ set +x; } 2>/dev/null
|
{ set +x; } 2>/dev/null
|
||||||
[[ "${DEBUG}" == [Yy]* ]] && echo
|
[[ "${DEBUG}" == [Yy1]* ]] && echo
|
||||||
|
|
||||||
#Check port forwarding flag
|
#Check port forwarding flag
|
||||||
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||||
@ -151,7 +151,7 @@ configureNAT () {
|
|||||||
|
|
||||||
# Build DNS options from container /etc/resolv.conf
|
# Build DNS options from container /etc/resolv.conf
|
||||||
|
|
||||||
if [[ "${DEBUG}" == [Yy]* ]]; then
|
if [[ "${DEBUG}" == [Yy1]* ]]; then
|
||||||
echo "/etc/resolv.conf:" && echo && cat /etc/resolv.conf && echo
|
echo "/etc/resolv.conf:" && echo && cat /etc/resolv.conf && echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ configureNAT () {
|
|||||||
|
|
||||||
DNSMASQ_OPTS=$(echo "$DNSMASQ_OPTS" | sed 's/\t/ /g' | tr -s ' ' | sed 's/^ *//')
|
DNSMASQ_OPTS=$(echo "$DNSMASQ_OPTS" | sed 's/\t/ /g' | tr -s ' ' | sed 's/^ *//')
|
||||||
|
|
||||||
[[ "${DEBUG}" == [Yy]* ]] && set -x
|
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
||||||
|
|
||||||
$DNSMASQ ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS}
|
$DNSMASQ ${DNSMASQ_OPTS:+ $DNSMASQ_OPTS}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy > /dev/null
|
|||||||
VM_NET_MAC="${VM_NET_MAC//-/:}"
|
VM_NET_MAC="${VM_NET_MAC//-/:}"
|
||||||
GATEWAY=$(ip r | grep default | awk '{print $3}')
|
GATEWAY=$(ip r | grep default | awk '{print $3}')
|
||||||
|
|
||||||
if [[ "${DEBUG}" == [Yy]* ]]; then
|
if [[ "${DEBUG}" == [Yy1]* ]]; then
|
||||||
|
|
||||||
IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)
|
||||||
echo "INFO: Container IP is ${IP} with gateway ${GATEWAY}" && echo
|
echo "INFO: Container IP is ${IP} with gateway ${GATEWAY}" && echo
|
||||||
@ -213,7 +213,7 @@ if [[ "${DEBUG}" == [Yy]* ]]; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${DHCP}" == [Yy]* ]]; then
|
if [[ "${DHCP}" == [Yy1]* ]]; then
|
||||||
|
|
||||||
if [[ "$GATEWAY" == "172."* ]]; then
|
if [[ "$GATEWAY" == "172."* ]]; then
|
||||||
echo -n "ERROR: You cannot enable DHCP while the container is "
|
echo -n "ERROR: You cannot enable DHCP while the container is "
|
||||||
@ -241,12 +241,12 @@ fi
|
|||||||
|
|
||||||
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet0,mac=${VM_NET_MAC},id=net0"
|
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet0,mac=${VM_NET_MAC},id=net0"
|
||||||
|
|
||||||
if [[ "${DHCP}" == [Yy]* ]]; then
|
if [[ "${DHCP}" == [Yy1]* ]]; then
|
||||||
# Add extra LAN interface for Docker Healthcheck script
|
# Add extra LAN interface for Docker Healthcheck script
|
||||||
NET_OPTS="${NET_OPTS} -netdev user,id=hostnet1,restrict=y,hostfwd=tcp::5555-:5000"
|
NET_OPTS="${NET_OPTS} -netdev user,id=hostnet1,restrict=y,hostfwd=tcp::5555-:5000"
|
||||||
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet1,id=net1"
|
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet1,id=net1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ "${DEBUG}" == [Yy]* ]] && echo && echo "Finished network setup.." && echo
|
[[ "${DEBUG}" == [Yy1]* ]] && echo && echo "Finished network setup.." && echo
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user