]>
Commit | Line | Data |
---|---|---|
6d4a602f | 1 | #!/bin/sh |
66c36198 PM |
2 | ############################################################################### |
3 | # # | |
4 | # IPFire.org - A linux based firewall # | |
5 | # Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> # | |
6 | # # | |
7 | # This program is free software: you can redistribute it and/or modify # | |
8 | # it under the terms of the GNU General Public License as published by # | |
9 | # the Free Software Foundation, either version 3 of the License, or # | |
10 | # (at your option) any later version. # | |
11 | # # | |
12 | # This program is distributed in the hope that it will be useful, # | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
15 | # GNU General Public License for more details. # | |
16 | # # | |
17 | # You should have received a copy of the GNU General Public License # | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. # | |
19 | # # | |
20 | ############################################################################### | |
6d4a602f | 21 | |
22 | . /etc/sysconfig/rc | |
23 | . ${rc_functions} | |
24 | ||
25 | case "${1}" in | |
26 | start) | |
27 | if ps ax | grep -v grep | grep /usr/bin/vmtoolsd > /dev/null | |
28 | then | |
29 | boot_mesg "vmtoolsd is running..." | |
30 | echo_warning | |
31 | else | |
32 | if /usr/bin/vmware-checkvm > /dev/null 2>&1; then | |
33 | boot_mesg "Starting..." | |
34 | /usr/bin/vmtoolsd & | |
35 | echo_ok | |
36 | else | |
37 | boot_mesg "IPFire is not running in a virtual machine." | |
38 | echo_failure | |
39 | fi | |
40 | fi | |
41 | ;; | |
66c36198 | 42 | |
6d4a602f | 43 | stop) |
44 | if ps ax | grep -v grep | grep /usr/bin/vmtoolsd > /dev/null | |
45 | then | |
46 | boot_mesg "Stopping..." | |
47 | killall /usr/bin/vmtoolsd > /dev/null | |
48 | echo_ok | |
49 | else | |
50 | boot_mesg "vmtoolsd is not running..." | |
51 | echo_warning | |
52 | fi | |
53 | ;; | |
54 | ||
55 | restart) | |
56 | ${0} stop | |
57 | sleep 1 | |
58 | ${0} start | |
59 | ;; | |
60 | ||
61 | status) | |
62 | statusproc /usr/bin/vmtoolsd | |
63 | ;; | |
64 | ||
65 | *) | |
66 | echo "Usage: ${0} {start|stop|restart}" | |
67 | exit 1 | |
68 | ;; | |
69 | esac |