5 |
|
|
6 |
set_system_service() |
set_system_service() |
7 |
{ |
{ |
8 |
local command="$1" |
local command="${CLASS_ARGV[0]}" |
9 |
local service="$2" |
local service="${CLASS_ARGV[1]}" |
10 |
local opts="$3" |
local opts="${CLASS_ARGV[2]}" |
11 |
|
|
12 |
[[ -z ${command} ]] && help_system_service && return 1 |
[[ -z ${command} ]] && help_system_service && return 1 |
13 |
[[ -z ${service} ]] && help_system_service && return 1 |
[[ -z ${service} ]] && help_system_service && return 1 |
14 |
|
|
15 |
if [[ ! -x ${MROOT}/etc/rc.d/init.d/${service} ]] |
if [[ ! -x ${MROOT}@@SYSVRCDDIR@@/${service} ]] |
16 |
then |
then |
17 |
eecho "Service '${service}' unkown!" |
eecho "Service '${service}' unknown!" |
18 |
return 1 |
return 1 |
19 |
fi |
fi |
20 |
|
|
29 |
fi |
fi |
30 |
|
|
31 |
case "${command}" in |
case "${command}" in |
32 |
start) /etc/rc.d/init.d/"${service}" start ;; |
start) @@SYSVRCDDIR@@/"${service}" start ;; |
33 |
stop) /etc/rc.d/init.d/"${service}" stop ;; |
stop) @@SYSVRCDDIR@@/"${service}" stop ;; |
34 |
restart) /etc/rc.d/init.d/"${service}" restart ;; |
restart) @@SYSVRCDDIR@@/"${service}" restart ;; |
35 |
reload) /etc/rc.d/init.d/"${service}" reload ;; |
reload) @@SYSVRCDDIR@@/"${service}" reload ;; |
36 |
enable) rc-config add "${service}" ;; |
enable) rc-config add "${service}" ;; |
37 |
disable) rc-config del "${service}" ;; |
disable) rc-config del "${service}" ;; |
38 |
*) help_system_service && return ;; |
*) help_system_service && return ;; |
41 |
|
|
42 |
get_system_service() |
get_system_service() |
43 |
{ |
{ |
44 |
local command="$1" |
local command="${CLASS_ARGV[0]}" |
45 |
local service="$2" |
local service="${CLASS_ARGV[1]}" |
46 |
|
|
47 |
[[ -z ${command} ]] && help_system_service && return 1 |
[[ -z ${command} ]] && help_system_service && return 1 |
48 |
[[ -z ${service} ]] && help_system_service && return 1 |
[[ -z ${service} ]] && help_system_service && return 1 |
49 |
|
|
50 |
if [[ ! -x ${MROOT}/etc/rc.d/init.d/${service} ]] |
if [[ ! -x ${MROOT}@@SYSVRCDDIR@@/${service} ]] |
51 |
then |
then |
52 |
eecho "Service '${service}' unkown!" |
eecho "Service '${service}' unknown!" |
53 |
return 1 |
return 1 |
54 |
fi |
fi |
55 |
|
|
64 |
fi |
fi |
65 |
|
|
66 |
case "${command}" in |
case "${command}" in |
67 |
status) /etc/rc.d/init.d/"${service}" status ;; |
status) @@SYSVRCDDIR@@/"${service}" status ;; |
68 |
enabled) rc-config show "${service}" ;; |
enabled) rc-config show "${service}" ;; |
69 |
runlevel) eecho "function on todo" ;; |
runlevel) eecho "function on todo" ;; |
70 |
*) help_system_service && return ;; |
*) help_system_service && return ;; |