aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/vmware3/files
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2000-11-02 20:20:26 +0800
committerknu <knu@FreeBSD.org>2000-11-02 20:20:26 +0800
commite88b047958b6f8b1b2d13282db654f28e81ee675 (patch)
tree785ae55f30b075833233f95d3c7e89d00d7a6b5b /emulators/vmware3/files
parentd1f3d14973f2555c54250d5cb834b8dc8510a1df (diff)
downloadfreebsd-ports-gnome-e88b047958b6f8b1b2d13282db654f28e81ee675.tar.gz
freebsd-ports-gnome-e88b047958b6f8b1b2d13282db654f28e81ee675.tar.zst
freebsd-ports-gnome-e88b047958b6f8b1b2d13282db654f28e81ee675.zip
Make the startup script read ${PREFIX}/etc/vmware/config so people do
not have discrepant configurations between them.
Diffstat (limited to 'emulators/vmware3/files')
-rw-r--r--emulators/vmware3/files/vmware.sh31
1 files changed, 26 insertions, 5 deletions
diff --git a/emulators/vmware3/files/vmware.sh b/emulators/vmware3/files/vmware.sh
index fe19977b293c..ee6db6d0d76b 100644
--- a/emulators/vmware3/files/vmware.sh
+++ b/emulators/vmware3/files/vmware.sh
@@ -4,13 +4,34 @@
#
# $FreeBSD$
-vmware_dir=@@PREFIX@@/lib/vmware
+vmware_config_file=@@PREFIX@@/etc/vmware/config
+
+if [ ! -e $vmware_config_file ]; then
+ echo "$vmware_config_file does not exist!" >&2
+ exit 255
+fi
+
+vmware_config() {
+ cat $vmware_config_file | while read var eq value; do
+ if [ "$1" = "$var" ]; then
+ ret=`expr "$value" : '"\(.*\)"$'`
+ echo ${ret:-$value}
+ break
+ fi
+ done
+}
+
+vmware=`vmware_config vmware.fullpath`
+vmware_libdir=`vmware_config libdir`
networking=@@NETWORKING@@
-host_ip=@@HOST_IP@@
-netmask=@@NETMASK@@
+host_ip=`vmware_config vmnet1.HostOnlyAddress`
+netmask=`vmware_config vmnet1.HostOnlyNetMask`
dev_vmnet1=@@LINUXBASE@@/dev/vmnet1
-[ -x $vmware_dir/bin/vmware ] || exit
+if [ ! -x $vmware ]; then
+ echo "$vmware does not exist!" >&2
+ exit 255
+fi
if [ `sysctl -n hw.ncpu` -eq 1 ]; then
suffix=up
@@ -22,7 +43,7 @@ exec >/dev/null
case $1 in
start)
- kldload ${vmware_dir}/lib/modules/vmmon_${suffix}.ko
+ kldload ${vmware_libdir}/modules/vmmon_${suffix}.ko
if [ $networking -eq 1 ]; then
sysctl net.link.ether.bridge_refresh && bridge="_bridge"
kldload if_tap.ko