Contents of /mcore-src/trunk/mcore-tools/src/modules/sysvinit/sysvinit.client.class.in
Parent Directory | Revision Log
Revision 2652 -
(show annotations)
(download)
Tue Nov 10 15:02:21 2015 UTC (8 years, 5 months ago) by niro
File size: 1222 byte(s)
Tue Nov 10 15:02:21 2015 UTC (8 years, 5 months ago) by niro
File size: 1222 byte(s)
-fixed broken command syntax
1 | # $Id$ |
2 | |
3 | provide basic-init sysvinit |
4 | require basic-system |
5 | |
6 | set_system_service() |
7 | { |
8 | local command="${CLASS_ARGV[0]}" |
9 | local service="${CLASS_ARGV[1]}" |
10 | local opts="${CLASS_ARGV[2]}" |
11 | |
12 | [[ -z ${command} ]] && help_system_service && return 1 |
13 | [[ -z ${service} ]] && help_system_service && return 1 |
14 | |
15 | case "${command}" in |
16 | start) mcore-system-service --start --service "${service}" ;; |
17 | stop) mcore-system-service --stop --service "${service}" ;; |
18 | restart) mcore-system-service --restart --service "${service}" ;; |
19 | reload) mcore-system-service --reload --service "${service}" ;; |
20 | enable) mcore-system-service --enable --service "${service}" ;; |
21 | disable) mcore-system-service --disable --service "${service}" ;; |
22 | *) help_system_service && return 1 ;; |
23 | esac |
24 | } |
25 | |
26 | get_system_service() |
27 | { |
28 | local command="${CLASS_ARGV[0]}" |
29 | local service="${CLASS_ARGV[1]}" |
30 | |
31 | [[ -z ${command} ]] && help_system_service && return 1 |
32 | [[ -z ${service} ]] && help_system_service && return 1 |
33 | |
34 | case "${command}" in |
35 | status) mcore-system-service --status --service "${service}" status ;; |
36 | enabled) mcore-system-service --enabled --service "${service}" ;; |
37 | runlevel) mcore-system-service --runlevel ;; |
38 | *) help_system_service && return 1 ;; |
39 | esac |
40 | } |