contrib/nm-live-vm: put qemu network-related options into a variable

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
This commit is contained in:
Jiří Klimeš 2014-01-30 16:26:55 +01:00 committed by Thomas Haller
parent 9b3922390c
commit 26626c75c3

View file

@ -1,5 +1,8 @@
#!/bin/sh
# Three network interfaces
NET_OPTIONS="-net nic -net user -net nic -net user -net nic -net user"
OS="Linux"
if [ -f /etc/redhat-release ]; then
OS=`cat /etc/redhat-release | cut -d" " -f1,2,3,4`
@ -13,7 +16,7 @@ if [ "$OS" == "Red Hat Enterprise Linux" ]; then
PATH=$PATH:/usr/libexec
qemu-kvm -vnc :0 -m 2048 -net nic -net user -net nic -net user -net nic -net user -kernel vmlinuz -append video='1024x768' -initrd initramfs.img &
qemu-kvm -vnc :0 -m 2048 $NET_OPTIONS -kernel vmlinuz -append video='1024x768' -initrd initramfs.img &
sleep 1
vncviewer localhost
@ -28,6 +31,6 @@ else
QEMU="qemu-system-$ARCH -enable-kvm"
}
$QEMU -m 2048 -net nic -net user -net nic -net user -net nic -net user -kernel vmlinuz -append video='1024x768' -initrd initramfs.img
$QEMU -m 2048 -net nic $NET_OPTIONS -kernel vmlinuz -append video='1024x768' -initrd initramfs.img
fi