diff options
author | Matthew James Goins <mjg2203@columbia.edu> | 2015-01-22 12:11:33 -0500 |
---|---|---|
committer | Matthew James Goins <mjg2203@columbia.edu> | 2015-01-22 12:11:33 -0500 |
commit | e09315c3dd663ce667c3f537dbbe511227368614 (patch) | |
tree | faa07eca8d6822e4a39b4dbf13b02dc08f5fe8e1 | |
parent | 86cac3b3cfc5519417b6cd2ab944b66ee154dffd (diff) | |
download | kvm-manager-e09315c3dd663ce667c3f537dbbe511227368614.tar.gz kvm-manager-e09315c3dd663ce667c3f537dbbe511227368614.tar.bz2 |
Make the bridge name a variable
-rwxr-xr-x | kvm-manager | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvm-manager b/kvm-manager index a8c7f9d..321bcb5 100755 --- a/kvm-manager +++ b/kvm-manager @@ -19,6 +19,7 @@ fi TAP="${TAP:-${VMNAME}0}" # MAC address is derived from a hash of the host's name and the guest's name: MAC="${MAC:-$(printf "02:%s" "$(printf "%s\0%s" "$(hostname)" "${VMNAME}" | sha256sum | sed 's/\(..\)/\1:/g' | cut -f1-5 -d:)" )}" +BRIDGE="${BRIDGE:-br0}" ################### OWNERGROUP=$(groups "$OWNER" | cut -f1 -d\ ) @@ -29,7 +30,7 @@ up() { modprobe -v tun ip tuntap add dev "$TAP" mode tap user "$OWNER" ip link set "$TAP" up - brctl addif br0 "$TAP" + brctl addif $BRIDGE "$TAP" chpst -u "$OWNER:$OWNERGROUP" mkdir -p "$OWNERHOME/vms/$VMNAME" @@ -132,7 +133,7 @@ EOF down() { - brctl delif br0 "$TAP" + brctl delif $BRIDGE "$TAP" ip link set "$TAP" down ip tuntap del mode tap dev "$TAP" # no need to lock up the block device as well, since the owner might |