updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / vmware-patch / vmware-rc
blob4660ecd19dcc95c3993e2374aa761131a4b17151
1 #!/bin/bash
3 daemon_name=vmware
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 if [ -f /etc/rc.d/vmware.d/init.d/vmware ] ; then
9 VMWARECTL=/etc/rc.d/vmware.d/init.d/vmware
10 elif [ -f /etc/rc.d/vmware ] ; then
11 VMWARECTL=/etc/rc.d/vmware
12 elif [ -f /etc/init.d/vmware ] ; then
13 VMWARECTL=/etc/init.d/vmware
14 else
15 echo -n "VMWare daemon startup script not found (/etc/rc.d/vmware, /etc/rc.d/vmware.d/init.d/vmware or /etc/init.d/vmware)"
16 stat_fail
17 exit 1
20 if [ -f /etc/rc.d/vmware.d/init.d/vmware-USBArbitrator ] ; then
21 VMWAREUSBCTL=/etc/rc.d/vmware.d/init.d/vmware-USBArbitrator
22 elif [ -f /etc/rc.d/vmware-USBArbitrator ] ; then
23 VMWAREUSBCTL=/etc/rc.d/vmware-USBArbitrator
24 elif [ -f /etc/init.d/vmware-USBArbitrator ] ; then
25 VMWAREUSBCTL=/etc/init.d/vmware-USBArbitrator
26 else
27 echo -n "No USBArbitrator found (/etc/rc.d/vmware or /etc/rc.d/vmware.d/init.d/vmware)"
30 case "$1" in
31 start)
32 ck_daemon hal && /etc/rc.d/hal start
33 stat_busy "Starting VMware Host"
34 if $VMWARECTL start ; then
35 add_daemon $daemon_name
36 stat_done
37 else
38 stat_fail
39 exit 1
41 if [ -n VMWAREUSBCTL ] ; then
42 stat_busy "Starting VMware USB Arbitrator"
43 if $VMWAREUSBCTL start ; then
44 add_daemon ${daemon_name}USB
45 stat_done
46 else
47 stat_fail
52 stop)
53 stat_busy "Stopping VMware Host"
54 ck_daemon ${daemon_name}USB && RES=true
55 if [ -n $RES ] ; then
56 stat_busy "Stopping VMware USB Arbitrator"
57 if $VMWAREUSBCTL stop ; then
58 rm_daemon ${daemon_name}USB
59 stat_done
60 else
61 stat_fail
65 if $VMWARECTL stop ; then
66 rm_daemon $daemon_name
67 stat_done
68 else
69 stat_fail
70 exit 1
74 status)
78 echo "usage: $0 {start|stop|reload|restart|status}"
79 esac
81 exit 0