Commit f0a8b4b0 by Stéphane Graber

Prefer iproute over ifconfig

parent faf09314
......@@ -35,29 +35,31 @@ _netmask2cidr ()
}
ifdown() {
which ifconfig >/dev/null 2>&1
if [ $? = 0 ]; then
ifconfig $1 down
return
fi
which ip >/dev/null 2>&1
if [ $? = 0 ]; then
ip link set dev $1 down
return
fi
}
ifup() {
which ifconfig >/dev/null 2>&1
if [ $? = 0 ]; then
ifconfig $1 $2 netmask $3 up
ifconfig $1 down
return
fi
}
ifup() {
which ip >/dev/null 2>&1
if [ $? = 0 ]; then
MASK=`_netmask2cidr ${LXC_NETMASK}`
CIDR_ADDR="${LXC_ADDR}/${MASK}"
ip addr add ${CIDR_ADDR} dev $1
ip link set dev $1 up
return
fi
which ifconfig >/dev/null 2>&1
if [ $? = 0 ]; then
ifconfig $1 $2 netmask $3 up
return
fi
}
......
......@@ -17,7 +17,7 @@ while true; do
if [ "$CRTOOLS_SCRIPT_ACTION" = "network-unlock" ]; then
brctl addif $bridge $veth
ifconfig $veth 0.0.0.0 up
ip link set dev $veth up
fi
i=$((i+1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment