summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/qemukvm/files/qemu-ifup
diff options
context:
space:
mode:
Diffstat (limited to 'os-plugins/plugins/qemukvm/files/qemu-ifup')
-rw-r--r--os-plugins/plugins/qemukvm/files/qemu-ifup9
1 files changed, 6 insertions, 3 deletions
diff --git a/os-plugins/plugins/qemukvm/files/qemu-ifup b/os-plugins/plugins/qemukvm/files/qemu-ifup
index 9cd2dd0b..59bcad85 100644
--- a/os-plugins/plugins/qemukvm/files/qemu-ifup
+++ b/os-plugins/plugins/qemukvm/files/qemu-ifup
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (c) 2009 - OpenSLX GmbH
+# Copyright (c) 2009..2010 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -28,8 +28,11 @@ case "$1" in
tap1)
# Configuring DHCP on host tap1 interface and enable IP masquerading
[ -d /tmp/qemu-$USER ] || mkdir -p /tmp/qemu-$USER
- sed "s,NWIF,tap1,;s,/misc/,/qemu/,;s,USER,$USER,;s,CNETWORK,$nataddress," \
- /etc/opt/openslx/udhcpd.qemukvm >/tmp/qemu-$USER/udhcpd.conf
+ # cut the last .NNN/MM from nataddress
+ sed -e "s,NWIF,tap1,;s,/misc/,/qemu/," \
+ -e "s,CNETWORK,${nataddress%.*},;s,PIDFILE,/tmp/qemu-$USER/udhcpd.pid," \
+ -e "s,LEASEFILE,/tmp/qemu-$USER/udhcpd.leases," \
+ /etc/opt/openslx/udhcpd.conf >/tmp/qemu-$USER/udhcpd.conf
touch /tmp/qemu-$USER/udhcpd.leases
# ip link set tap1 up
# ip addr add 192.168.101.254/24 dev tap1