2000-01-26 22:06:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Start or stop vmware
|
|
|
|
#
|
2000-01-28 06:25:44 +00:00
|
|
|
# $FreeBSD$
|
2000-01-26 22:06:13 +00:00
|
|
|
|
|
|
|
vmware_dir=@@PREFIX@@/lib/vmware
|
|
|
|
networking=@@NETWORKING@@
|
|
|
|
host_ip=@@HOST_IP@@
|
|
|
|
netmask=@@NETMASK@@
|
|
|
|
|
|
|
|
[ -x $vmware_dir/bin/vmware ] || exit
|
2000-03-29 21:23:07 +00:00
|
|
|
|
|
|
|
if [ `sysctl -n hw.ncpu` -eq 1 ]; then
|
|
|
|
suffix=up
|
|
|
|
else
|
|
|
|
suffix=smp
|
|
|
|
fi
|
|
|
|
|
2000-01-28 06:22:56 +00:00
|
|
|
exec >/dev/null
|
2000-01-26 22:06:13 +00:00
|
|
|
|
|
|
|
case $1 in
|
2000-03-25 20:24:32 +00:00
|
|
|
start)
|
2000-03-29 21:23:07 +00:00
|
|
|
kldload ${vmware_dir}/lib/modules/vmmon_${suffix}.ko
|
2000-03-25 20:24:32 +00:00
|
|
|
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
|
|
|
|
;;
|
2000-01-26 22:06:13 +00:00
|
|
|
|
2000-03-25 20:24:32 +00:00
|
|
|
stop)
|
2000-03-29 21:23:07 +00:00
|
|
|
kldunload vmmon_${suffix}
|
2000-03-25 20:24:32 +00:00
|
|
|
if [ $networking -eq 1 ]; then
|
|
|
|
ifconfig vmnet1 down
|
|
|
|
ifconfig vmnet1 delete $host_ip
|
|
|
|
kldunload vmnet
|
|
|
|
fi
|
|
|
|
;;
|
2000-01-26 22:06:13 +00:00
|
|
|
|
2000-03-25 20:24:32 +00:00
|
|
|
*)
|
|
|
|
echo "usage: `basename $0` {start|stop}" >&2
|
|
|
|
exit 64
|
|
|
|
;;
|
2000-01-26 22:06:13 +00:00
|
|
|
esac
|