]>
Commit | Line | Data |
---|---|---|
6d4a602f | 1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/ | |
4 | # | |
5 | # Description : init-script for open-vm-tools | |
6 | # | |
f3549ba5 | 7 | # Authors : Jan Paul Tuecking (earl@ipfire.org) |
6d4a602f | 8 | # |
f3549ba5 | 9 | # Version : 1.00 |
6d4a602f | 10 | # |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
17 | ||
18 | case "${1}" in | |
19 | start) | |
20 | if ps ax | grep -v grep | grep /usr/bin/vmtoolsd > /dev/null | |
21 | then | |
22 | boot_mesg "vmtoolsd is running..." | |
23 | echo_warning | |
24 | else | |
25 | if /usr/bin/vmware-checkvm > /dev/null 2>&1; then | |
26 | boot_mesg "Starting..." | |
27 | /usr/bin/vmtoolsd & | |
28 | echo_ok | |
29 | else | |
30 | boot_mesg "IPFire is not running in a virtual machine." | |
31 | echo_failure | |
32 | fi | |
33 | fi | |
34 | ;; | |
35 | ||
36 | stop) | |
37 | if ps ax | grep -v grep | grep /usr/bin/vmtoolsd > /dev/null | |
38 | then | |
39 | boot_mesg "Stopping..." | |
40 | killall /usr/bin/vmtoolsd > /dev/null | |
41 | echo_ok | |
42 | else | |
43 | boot_mesg "vmtoolsd is not running..." | |
44 | echo_warning | |
45 | fi | |
46 | ;; | |
47 | ||
48 | restart) | |
49 | ${0} stop | |
50 | sleep 1 | |
51 | ${0} start | |
52 | ;; | |
53 | ||
54 | status) | |
55 | statusproc /usr/bin/vmtoolsd | |
56 | ;; | |
57 | ||
58 | *) | |
59 | echo "Usage: ${0} {start|stop|restart}" | |
60 | exit 1 | |
61 | ;; | |
62 | esac | |
63 | ||
64 | # End $rc_base/init.d/ |