diff options
Diffstat (limited to 'emulators/vmware3/files/vmware.sh')
-rw-r--r-- | emulators/vmware3/files/vmware.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/emulators/vmware3/files/vmware.sh b/emulators/vmware3/files/vmware.sh new file mode 100644 index 0000000..b3fa842 --- /dev/null +++ b/emulators/vmware3/files/vmware.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Start or stop vmware +# + +vmware_dir=@@PREFIX@@/lib/vmware +networking=@@NETWORKING@@ +host_ip=@@HOST_IP@@ +netmask=@@NETMASK@@ + +[ -x $vmware_dir/bin/vmware ] || exit +exec >/dev/null + +case $1 in + start) + kldload ${vmware_dir}/lib/modules/vmmon.ko + if [ $networking -eq 1 ]; then + kldload ${vmware_dir}/lib/modules/vmnet.ko + echo -n >/dev/vmnet1 + ifconfig vmnet1 $host_ip netmask $netmask + fi + echo -n " VMware" >/dev/tty + ;; + + stop) + kldunload vmmon + if [ $networking -eq 1 ]; then + ifconfig vmnet1 down + ifconfig vmnet1 delete $host_ip + kldunload vmnet + fi + ;; + + *) + echo "usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac |