]>
Commit | Line | Data |
---|---|---|
c27d58f3 DM |
1 | #!/bin/sh |
2 | ||
3 | # create a VETH device and plug it into bridge ${IF_VETH_BRIDGETO} | |
4 | ||
5 | if [ -z "${IF_VETH_BRIDGETO}" ]; then | |
6 | exit 0 | |
7 | fi | |
8 | ||
9 | if [ ! -x /sbin/brctl ] | |
10 | then | |
11 | exit 0 | |
12 | fi | |
13 | ||
14 | if [ "${MODE}" = "start" ]; then | |
15 | ifconfig "${IF_VETH_BRIDGETO}" up | |
16 | ip link add name "${IFACE}" type veth peer name "${IFACE}peer" | |
17 | ip link set "${IFACE}peer" up | |
18 | brctl addif "${IF_VETH_BRIDGETO}" "${IFACE}peer" | |
19 | elif [ "${MODE}" = "stop" ]; then | |
20 | brctl delif "${IF_VETH_BRIDGETO}" "${IFACE}peer" | |
21 | ip link set "${IFACE}peer" down | |
22 | ip link del "${IFACE}" | |
23 | fi | |
24 | ||
25 | exit 0 |