summaryrefslogtreecommitdiff
path: root/emulators/vmware2/files/vmware.sh
blob: b3fa8424c1c60fce6b37056d7bc82c1b367e08d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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