blob: fe19977b293cb39e35a5a4dc2732c396f63cf9dd (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#!/bin/sh
#
# Start or stop vmware
#
# $FreeBSD$
vmware_dir=@@PREFIX@@/lib/vmware
networking=@@NETWORKING@@
host_ip=@@HOST_IP@@
netmask=@@NETMASK@@
dev_vmnet1=@@LINUXBASE@@/dev/vmnet1
[ -x $vmware_dir/bin/vmware ] || exit
if [ `sysctl -n hw.ncpu` -eq 1 ]; then
suffix=up
else
suffix=smp
fi
exec >/dev/null
case $1 in
start)
kldload ${vmware_dir}/lib/modules/vmmon_${suffix}.ko
if [ $networking -eq 1 ]; then
sysctl net.link.ether.bridge_refresh && bridge="_bridge"
kldload if_tap.ko
if [ ! -e $dev_vmnet1 ]; then
echo "$dev_vmnet1 does not exist!" >&2
echo "Your VMware installation seems broken. Please reinstall VMware port." >&2
exit 255
fi
echo -n > $dev_vmnet1
ifconfig vmnet1 $host_ip netmask $netmask
if [ _$bridge != _ ]; then
sysctl -w net.link.ether.bridge_refresh=1
sysctl -w net.link.ether.bridge=1
fi
fi
echo -n " VMware${bridge}" >&2
;;
stop)
kldunload vmmon_${suffix}
if [ $networking -eq 1 ]; then
ifconfig vmnet1 down
ifconfig vmnet1 delete $host_ip
sysctl net.link.ether.bridge_refresh && bridge="_bridge"
[ _$bridge != _ ] && sysctl -w net.link.ether.bridge_refresh=1
fi
;;
*)
echo "usage: `basename $0` {start|stop}" >&2
exit 64
;;
esac
|